What is actually happening in VirtualizingStackPanel.VirtualizationMode = Recycling/Standard.?
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
When
VirtualizationMode
is set toRecycling
, theVirtualizingStackPanel
will reuse item containers instead of having to create a new one. If we start out with thisAnd scroll one position down, so Data 1 is scrolled out of view and Data 4 is scrolled into view then Recyling will take the item container for Data 1 and reuse it for Data 4.
I've had some problems with this when using attached properties for the Item container, e.g Green background if I have entered edit mode for Container 1. Scrolling down and Data 4 will also have Green background since the Attached Property was still set.
When
VirtualizationMode
is set toStandard
, theVirtualizingStackPanel
will create and discard item containers instead of reusing them.