VirtualizingStackPanel
VirtualizingStackPanel
VirtualizingStackPanel
VirtualizingStackPanel
Class
Definition
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.
public : sealed class VirtualizingStackPanel : OrientedVirtualizingPanel, IVirtualizingStackPanel, IVirtualizingStackPanelOverridespublic sealed class VirtualizingStackPanel : OrientedVirtualizingPanel, IVirtualizingStackPanel, IVirtualizingStackPanelOverridesPublic NotInheritable Class VirtualizingStackPanel Inherits OrientedVirtualizingPanel Implements IVirtualizingStackPanel, IVirtualizingStackPanelOverrides// This API is not available in Javascript.
<VirtualizingStackPanel .../>
-or-
<VirtualizingStackPanel ...>
oneOrMoreChildren
</VirtualizingStackPanel>
- Inheritance
-
OrientedVirtualizingPanelOrientedVirtualizingPanelOrientedVirtualizingPanelOrientedVirtualizingPanelVirtualizingStackPanelVirtualizingStackPanelVirtualizingStackPanelVirtualizingStackPanel
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited properties
Inherited events
Inherited methods
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.
VirtualizingStackPanel attached properties
VirtualizingStackPanel is the host service class for several attached properties that control or report the virtualization mode:
- VirtualizingStackPanel.VirtualizationMode
- VirtualizingStackPanel.IsVirtualizing
VirtualizingStackPanel.VirtualizationMode is an Extensible Application Markup Language (XAML) attached property, and child elements set this property in markup to declare how the item should be virtualized when included as a VirtualizingStackPanel child element.
VirtualizingStackPanel.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.
Constructors
VirtualizingStackPanel() VirtualizingStackPanel() VirtualizingStackPanel() VirtualizingStackPanel()
Initializes a new instance of the VirtualizingStackPanel class.
public : VirtualizingStackPanel()public VirtualizingStackPanel()Public Sub New()// This API is not available in Javascript.
Properties
AreScrollSnapPointsRegular AreScrollSnapPointsRegular AreScrollSnapPointsRegular AreScrollSnapPointsRegular
Gets or sets a value that indicates whether the generated snap points used for panning in the VirtualizingStackPanel are equidistant from each other.
public : PlatForm::Boolean AreScrollSnapPointsRegular { get; set; }public bool AreScrollSnapPointsRegular { get; set; }Public ReadWrite Property AreScrollSnapPointsRegular As bool// This API is not available in Javascript.
<VirtualizingStackPanel AreScrollSnapPointsRegular="bool" .../>
- Value
- PlatForm::Boolean bool bool bool
true if the snap points in the VirtualizingStackPanel are equidistant from each other; otherwise, false.
AreScrollSnapPointsRegularProperty AreScrollSnapPointsRegularProperty AreScrollSnapPointsRegularProperty AreScrollSnapPointsRegularProperty
Identifies the AreScrollSnapPointsRegular dependency property.
public : static DependencyProperty AreScrollSnapPointsRegularProperty { get; }public static DependencyProperty AreScrollSnapPointsRegularProperty { get; }Public Static ReadOnly Property AreScrollSnapPointsRegularProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the AreScrollSnapPointsRegular dependency property.
IsVirtualizingProperty IsVirtualizingProperty IsVirtualizingProperty IsVirtualizingProperty
Identifies the VirtualizingStackPanel.IsVirtualizing attached property.
public : static DependencyProperty IsVirtualizingProperty { get; }public static DependencyProperty IsVirtualizingProperty { get; }Public Static ReadOnly Property IsVirtualizingProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the VirtualizingStackPanel.IsVirtualizing attached property.
Remarks
VirtualizingStackPanel.IsVirtualizing is an atypical attached property because it does not have a Set accessor, and thus is not really a XAML attached property with a markup usage. Instead, VirtualizingStackPanel.IsVirtualizing functions as a sentinel whereby child elements can query the VirtualizingStackPanel parent, and determine whether virtualization is being used. This might be important information for layout logic or further virtualization logic that is used by the child element itself.
Orientation Orientation Orientation Orientation
Gets or sets a value that describes the horizontal or vertical orientation of stacked content.
public : Orientation Orientation { get; set; }public Orientation Orientation { get; set; }Public ReadWrite Property Orientation As Orientation// This API is not available in Javascript.
<VirtualizingStackPanel Orientation="Horizontal"/>
- or -
<VirtualizingStackPanel Orientation="Vertical"/>
The Orientation of child content, as a value of the enumeration. The default is Vertical.
OrientationProperty OrientationProperty OrientationProperty OrientationProperty
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }public static DependencyProperty OrientationProperty { get; }Public Static ReadOnly Property OrientationProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the Orientation dependency property.
VirtualizationModeProperty VirtualizationModeProperty VirtualizationModeProperty VirtualizationModeProperty
Identifies the VirtualizingStackPanel.VirtualizationMode XAML attached property.
public : static DependencyProperty VirtualizationModeProperty { get; }public static DependencyProperty VirtualizationModeProperty { get; }Public Static ReadOnly Property VirtualizationModeProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the VirtualizingStackPanel.VirtualizationMode XAML attached property.
Methods
GetIsVirtualizing(DependencyObject) GetIsVirtualizing(DependencyObject) GetIsVirtualizing(DependencyObject) GetIsVirtualizing(DependencyObject)
Gets a value that determines whether an item is currently being virtualized as part of an items set where the ItemsPanel is templated with a VirtualizingStackPanel.
public : static PlatForm::Boolean GetIsVirtualizing(DependencyObject o)public static bool GetIsVirtualizing(DependencyObject o)Public Static Function GetIsVirtualizing(o As DependencyObject) As bool// This API is not available in Javascript.
The object item where you want to determine the current virtualization state.
true if the item specified by o is currently virtualizing its content; otherwise, false.
Remarks
VirtualizingStackPanel.IsVirtualizing uses the attached property model as a property store, but does not support a 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.
GetVirtualizationMode(DependencyObject) GetVirtualizationMode(DependencyObject) GetVirtualizationMode(DependencyObject) GetVirtualizationMode(DependencyObject)
Gets the VirtualizingStackPanel.VirtualizationMode XAML attached property value for the specified target element.
public : static VirtualizationMode GetVirtualizationMode(DependencyObject element)public static VirtualizationMode GetVirtualizationMode(DependencyObject element)Public Static Function GetVirtualizationMode(element As DependencyObject) As VirtualizationMode// This API is not available in Javascript.
The object from which the VirtualizationMode is read.
One of the enumeration values that specifies whether the object uses container recycling.
Remarks
For more info, see the VirtualizingStackPanel.VirtualizationMode attached property.
- See Also
OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs) OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs) OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs) OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)
Called when an item that is hosted by the VirtualizingStackPanel is re-virtualized.
protected : virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)protected virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)Protected Overridable Function OnCleanUpVirtualizedItem(e As CleanUpVirtualizedItemEventArgs) As void// This API is not available in Javascript.
SetVirtualizationMode(DependencyObject, VirtualizationMode) SetVirtualizationMode(DependencyObject, VirtualizationMode) SetVirtualizationMode(DependencyObject, VirtualizationMode) SetVirtualizationMode(DependencyObject, VirtualizationMode)
Sets the VirtualizingStackPanel.VirtualizationMode XAML attached property on the specified target element.
public : static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)public static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)Public Static Function SetVirtualizationMode(element As DependencyObject, value As VirtualizationMode) As void// This API is not available in Javascript.
The target element.
One of the enumeration values that specifies whether element uses container recycling.
Remarks
For more info, see the VirtualizingStackPanel.VirtualizationMode attached property.
- See Also
Events
CleanUpVirtualizedItemEvent CleanUpVirtualizedItemEvent CleanUpVirtualizedItemEvent CleanUpVirtualizedItemEvent
Occurs when an item that is hosted by the VirtualizingStackPanel is re-virtualized.
public : event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEventpublic event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEventPublic Event CleanUpVirtualizedItemEvent// This API is not available in Javascript.
<VirtualizingStackPanel CleanUpVirtualizedItemEvent="eventhandler" />