TreeView with VirtualizingPanel Scroll Behavior
Hello!
I am using a TreeView element with a configuration similar to the "Properties" TreeView used in the Noesis Inspector code (included below):
I'm noticing an interesting behavior with directional navigation and the scroll behavior, where directionally navigating down or up between TreeViewItems at the bottom or top of the viewport does not scroll down or up to show the full item, but rather about 2/3 of the item, even if it is the last or first item in the list. This results in needing to explicitly scroll up or down to view the rest of the list. You can see this behavior in the Inspector itself - when the Properties list for an element is displayed, if you directionally navigate from the second-to-last item to the last item while the last item is not in view, the bottom of it is cut off, requiring you to move the scroll bar to see the end of the list.
My guess is that this has something to do with the scroll unit being set to pixel, but I wanted to see if this was the expected behavior, and if so, what the best way to modify the ScrollViewer might be to ensure that directionally navigating calculates the vertical offset so that the full item or beginning/end of list was displayed.
I am using a TreeView element with a configuration similar to the "Properties" TreeView used in the Noesis Inspector code (included below):
Code: Select all
<TreeView x:Name="Properties" Grid.Row="2"
ItemsSource="{Binding FilteredItems, ElementName=FilteredProperties}"
ItemTemplate="{StaticResource Template.LiveProperties}"
HorizontalContentAlignment="Stretch"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.CanContentScroll="True"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling"
VirtualizingPanel.ScrollUnit="Pixel"
Background="{StaticResource Brush.Section.ContentBg}">My guess is that this has something to do with the scroll unit being set to pixel, but I wanted to see if this was the expected behavior, and if so, what the best way to modify the ScrollViewer might be to ensure that directionally navigating calculates the vertical offset so that the full item or beginning/end of list was displayed.
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: TreeView with VirtualizingPanel Scroll Behavior
Hi, I was able to reproduce it in our Inspector, and it is not the expected behavior, could you please report it in our bugtracker?
It must be something related to the calculations done in the RequestBringIntoView event. We'll take a look and fix it as soon as possible.
It must be something related to the calculations done in the RequestBringIntoView event. We'll take a look and fix it as soon as possible.
Re: TreeView with VirtualizingPanel Scroll Behavior
Reported here: #2447. Thanks for looking into it!
Who is online
Users browsing this forum: No registered users and 12 guests