mariorancic
Topic Author
Posts: 10
Joined: 20 Jul 2019, 22:50

ScrollBar on ListBox

24 Jan 2021, 23:21

I have 2 question regarding ScrollBar on ListBox,
1. When I set VirtualizingStackPanel.ScrollUnit="Pixel" and also i am using virtualization, then I scroll to bottom with just few items and only when i click on bottom arrow I can scroll more. WhenScrollUnit is Item then this works ok.

2. I override Thumb and ScrollBar templates but still scrollbar on Listbox are not changed. What should I do. I saw on forums manz people wer talking about NoesisStyle.xaml but how to get it.

I actually test all of this on Ubuntu on WSL2 on X410 Server and everzthing works the same like on Windows.
 
User avatar
sfernandez
Site Admin
Posts: 2255
Joined: 22 Dec 2011, 19:20

Re: ScrollBar on ListBox

25 Jan 2021, 12:14

1. How are you scrolling the list, using mouse wheel?

2. Are you using our theme styles? If not, how is ScrollViewer template defined?
In our theme, the ScrollViewer template uses the ScrollBar without explicitly specifying a template or style, so it will rely on typed style resources to find the style it will use for the ScrollBar. You probably need to define a typed style too:
<ControlTemplate x:Key="MyScrollBarTemplate" TargetType="ScrollBar">...</ControlTemplate>
<Style TargetType="ScrollBar" BasedOn="{StaticResource {x:Type ScrollBar}}">
  <Setter Property="Template" Value="{StaticResource MyScrollBarTemplate}"/>
  ...
</Style>

Who is online

Users browsing this forum: Google [Bot] and 1 guest