Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 4.08 KB

virtualizingstackpanel.md

File metadata and controls

46 lines (32 loc) · 4.08 KB
-api-id -api-type
T:Microsoft.UI.Xaml.Controls.VirtualizingStackPanel
winrt class

Microsoft.UI.Xaml.Controls.VirtualizingStackPanel

-description

Arranges and virtualizes content on a single line that is oriented either horizontally or vertically. Can only be used to display items in an ItemsControl.

-xaml-syntax

<VirtualizingStackPanel .../>
-or-
<VirtualizingStackPanel ...>
  oneOrMoreChildren
</VirtualizingStackPanel>

-remarks

VirtualizingStackPanel can only be used to display items in an ItemsControl. A primary scenario for VirtualizingStackPanel is that it provides the items panel template behavior for FlipView and ListBox in default templates.

Note

Starting in Windows 8.1, ItemsStackPanel is used as the default ItemsPanel for ListView. If you modify the ItemsPanel, we recommend you use ItemsStackPanel or ItemsWrapGrid instead of VirtualizingStackPanel or WrapGrid.

XAML attached properties

VirtualizingStackPanel is the host service class for several XAML attached properties.

In order to support XAML processor access to the attached properties, and also to expose equivalent get and set operations to code, each XAML attached property has a pair of Get and Set accessor methods. Another way to get or set the value in code is to use the dependency property system, calling either GetValue or SetValue and passing the identifier field as the dependency property identifier.

Attached property Description
IsVirtualizing See RemarksVirtualizingStackPanel.IsVirtualizing uses the attached property model as a property store, but does not support a Extensible Application Markup Language (XAML) usage. Instead, the property serves as a sentinel that any VirtualizingStackPanel child element can check to determine whether that child is currently being represented as virtualized. To find out if an item is being virtualized, call GetIsVirtualizing, passing the item as the input parameter.
VirtualizationMode Gets or sets a value that indicates the virtualization mode of items being virtualized by a parent VirtualizingStackPanel and items set. Child elements set this property in markup to declare how the item should be virtualized when included as a VirtualizingStackPanel child element.

-examples

-see-also

OrientedVirtualizingPanel, IScrollSnapPointsInfo, ItemsControl.ItemsPanel, ItemsPanelTemplate, List view and grid view