C
C#5mo ago
Mekasu0124

✅ How To Style ScrollBar Avalonia

<Style Selector="ScrollViewer.CreateUserScroll">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="10" />
</Style>

<Style Selector="ScrollBar">
<Setter Property="Background" Value="{DynamicResource ButtonSecondaryNight}" />
<Setter Property="Foreground" Value="{DynamicResource TextColorNight}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPrimaryNight}" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Padding" Value="20" />
</Style>
<Style Selector="ScrollViewer.CreateUserScroll">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="10" />
</Style>

<Style Selector="ScrollBar">
<Setter Property="Background" Value="{DynamicResource ButtonSecondaryNight}" />
<Setter Property="Foreground" Value="{DynamicResource TextColorNight}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPrimaryNight}" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Padding" Value="20" />
</Style>
I'm trying to follow the repo's page on styling the ScrollBar for the screen I'm working on. I'm trying to get it so that the border of the outter most part of the scroll bar is the ButtonPrimaryNight dynamic resource and the background is transparent. Then the moving part inside of the ScrollBar I would like to have the color of dynamic resource TextColorNight and I'd like to have some space on the inside around the moving part of the scroll bar. If anyone can help achieve this, I would greatly appreciate it.
GitHub
Avalonia/src/Avalonia.Themes.Fluent/Controls/ScrollBar.xaml at mast...
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology - AvaloniaUI/Avalonia
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server