Scrolling in virtualized WPF TreeView is very unstable

后端 未结 3 953
野趣味
野趣味 2021-02-06 22:47

If virtualizing is enabled in TreeView with items having various sizes, multiple problems appear:

  • Vertical scroll bar changes its size randomly and

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-06 23:19

    By default Virtualization Stack panel uses pixel rendering to render child elements and the Recycling mode will discard each elements inside the treeview container that is no longer needed in UI. This cause the scroll bar size to change automatically. The VirtualizationPanel Pixel rendering technique will leads to slow down the scrolling option also. By changing to VirtualizingPanel.ScrollUnit="Item" will solve your issues. Below xaml is working fine for me

    
    
        
            
                
                    
                
            
        
    
    
    

提交回复
热议问题