VirtualizingStackPanel VirtualizingStackPanel VirtualizingStackPanel Class

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.

Syntax

Declaration

public sealed class VirtualizingStackPanelpublic sealed class VirtualizingStackPanelPublic NotInheritable Class VirtualizingStackPanel
<VirtualizingStackPanel .../>
-or-
<VirtualizingStackPanel ...>
  oneOrMoreChildren
</VirtualizingStackPanel>

Inheritance Hierarchy

Inherited Members

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetRegularSnapPoints(Windows.UI.Xaml.Controls.Orientation,Windows.UI.Xaml.Controls.Primitives.SnapPointsAlignment,System.Single)
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetRegularSnapPoints(Windows.UI.Xaml.Controls.Orientation,Windows.UI.Xaml.Controls.Primitives.SnapPointsAlignment,System.Single)
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetRegularSnapPoints(Windows.UI.Xaml.Controls.Orientation,Windows.UI.Xaml.Controls.Primitives.SnapPointsAlignment,System.Single)
, ,
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetInsertionIndexes(Windows.Foundation.Point,System.Int32,System.Int32)
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetInsertionIndexes(Windows.Foundation.Point,System.Int32,System.Int32)
Windows.UI.Xaml.Controls.Primitives.OrientedVirtualizingPanel.GetInsertionIndexes(Windows.Foundation.Point,System.Int32,System.Int32)
, ,

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:

VirtualizationModeProperty 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(Windows.UI.Xaml.DependencyObject), passing the item as the input parameter.

Constructors summary

Initializes a new instance of the VirtualizingStackPanel class.

Properties summary

Gets or sets a value that indicates whether the generated snap points used for panning in the VirtualizingStackPanel are equidistant from each other.

Identifies the AreScrollSnapPointsRegular dependency property.

Identifies the VirtualizingStackPanel.IsVirtualizing attached property.

Gets or sets a value that describes the horizontal or vertical orientation of stacked content.

Identifies the Orientation dependency property.

Identifies the VirtualizationModeProperty XAML attached property.

Methods summary

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.

Gets the VirtualizationModeProperty XAML attached property value for the specified target element.

Sets the VirtualizationModeProperty XAML attached property on the specified target element.

Events summary

Occurs when an item that is hosted by the VirtualizingStackPanel is re-virtualized.

Constructors

  • VirtualizingStackPanel()
    VirtualizingStackPanel()
    VirtualizingStackPanel()
    VirtualizingStackPanel()

    Initializes a new instance of the VirtualizingStackPanel class.

    public VirtualizingStackPanel()public VirtualizingStackPanel()Public Function VirtualizingStackPanel() As

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 bool AreScrollSnapPointsRegular { get; set; }public bool AreScrollSnapPointsRegular { get; set; }Public ReadWrite Property AreScrollSnapPointsRegular As bool
    <VirtualizingStackPanel AreScrollSnapPointsRegular="bool" .../>
    

    Property Value

    • 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

    Property Value

  • 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

    Property Value

    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
    <VirtualizingStackPanel Orientation="Horizontal"/>
    - or -
    <VirtualizingStackPanel Orientation="Vertical"/>
    

    Property Value

  • 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

    Property Value

  • VirtualizationModeProperty
    VirtualizationModeProperty
    VirtualizationModeProperty
    VirtualizationModeProperty

    Identifies the VirtualizationModeProperty XAML attached property.

    public static DependencyProperty VirtualizationModeProperty { get; }public static DependencyProperty VirtualizationModeProperty { get; }Public Static ReadOnly Property VirtualizationModeProperty As DependencyProperty

    Property Value

Methods

  • GetIsVirtualizing(Windows.UI.Xaml.DependencyObject)
    GetIsVirtualizing(Windows.UI.Xaml.DependencyObject)
    GetIsVirtualizing(Windows.UI.Xaml.DependencyObject)
    GetIsVirtualizing(Windows.UI.Xaml.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 bool GetIsVirtualizing(Windows.UI.Xaml.DependencyObject)public static bool GetIsVirtualizing(Windows.UI.Xaml.DependencyObject)Public Static Function GetIsVirtualizing(Windows.UI.Xaml.DependencyObject) As bool

    Parameters

    Returns

    • bool
      bool
      bool

      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(Windows.UI.Xaml.DependencyObject), passing the item as the input parameter.

  • GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)
    GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)
    GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)
    GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)

    Gets the VirtualizationModeProperty XAML attached property value for the specified target element.

    public static VirtualizationMode GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)public static VirtualizationMode GetVirtualizationMode(Windows.UI.Xaml.DependencyObject)Public Static Function GetVirtualizationMode(Windows.UI.Xaml.DependencyObject) As VirtualizationMode

    Parameters

    Returns

    Remarks

    For more info, see the VirtualizationModeProperty attached property.

  • SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)
    SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)
    SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)
    SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)

    Sets the VirtualizationModeProperty XAML attached property on the specified target element.

    public static void SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)public static void SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode)Public Static Function SetVirtualizationMode(Windows.UI.Xaml.DependencyObject,Windows.UI.Xaml.Controls.VirtualizationMode) As void

    Parameters

    Remarks

    For more info, see the VirtualizationModeProperty attached property.

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
    <VirtualizingStackPanel CleanUpVirtualizedItemEvent="eventhandler" />
    

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.ActivatableAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll