Virtualization works well if all items in ItemsPresenter (and TreeView implemented as ItemsPresenter with nested ItemsPresenters ) are the same height. With TreeView this is usually not the case.
The main reason for this is that, since it is virtualized, it must evaluate certain things that it would otherwise accurately determine:
VirtualizationStackPanel will assume that all children are the same height as the currently visible children, and will evaluate the desired height based on this (instead of actually measuring all children) reported by ScrollViewer , if the children have a variable height, this estimate may be disabled and will change depending on the scroll position, which will result in a constantly changing scrollbar width.
Bubblewrap
source share