Show / Hide Table of Contents

Class VirtualizingStackPanel

Arranges and virtualizes content on a single line that is oriented either horizontally or vertically.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Panel
VirtualizingPanel
VirtualizingStackPanel
Implements
IScrollInfo
Inherited Members
VirtualizingPanel.ItemContainerGenerator
VirtualizingPanel.AddInternalChild(UIElement)
VirtualizingPanel.InsertInternalChild(Int32, UIElement)
VirtualizingPanel.RemoveInternalChildRange(Int32, Int32)
Panel.LogicalChildren
Panel.VisualChildrenCount
Panel.GetVisualChild(Int32)
Panel.CreateUIElementCollection(FrameworkElement)
Panel.ProgressiveRenderingChunkSize
Panel.BackgroundProperty
Panel.Background
Panel.Children
Panel.INTERNAL_OnAttachedToVisualTree()
Panel.GetTemplateChild(String)
Panel.IsItemsHostProperty
Panel.IsItemsHost
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.CreateDomElement(Object, Object)
FrameworkElement.OnApplyTemplate()
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.ManageIsEnabled(Boolean)
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class VirtualizingStackPanel : VirtualizingPanel, IFrameworkElement, IUIElement, IDependencyObject, IScrollInfo

Constructors

| Improve this Doc View Source

VirtualizingStackPanel()

Initializes a new instance of the VirtualizingStackPanel class.

Declaration
public VirtualizingStackPanel()

Fields

| Improve this Doc View Source

IsVirtualizingProperty

A value that indicates whether the VirtualizingStackPanel is using virtualization.

Declaration
public static readonly DependencyProperty IsVirtualizingProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

OrientationProperty

Identifies the Orientation dependency property.

Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

VirtualizationModeProperty

The current virtualization mode of the VirtualizingStackPanel (whether it is Recycling or not).

Declaration
public static readonly DependencyProperty VirtualizationModeProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

CanHorizontallyScroll

Gets or sets a value that indicates whether a VirtualizingStackPanel can scroll in the horizontal dimension.

Declaration
public bool CanHorizontallyScroll { get; set; }
Property Value
Type Description
System.Boolean

true if content can scroll in the horizontal dimension; otherwise, false. The default is false.

| Improve this Doc View Source

CanVerticallyScroll

Gets or sets a value that indicates whether content can scroll in the vertical dimension.

Declaration
public bool CanVerticallyScroll { get; set; }
Property Value
Type Description
System.Boolean

true if content can scroll in the vertical dimension; otherwise, false. The default is false.

| Improve this Doc View Source

ExtentHeight

Gets a value that contains the vertical size of the extent.

Declaration
public double ExtentHeight { get; }
Property Value
Type Description
System.Double

A System.Double that represents the vertical size of the extent, in pixels. The default is 0.

| Improve this Doc View Source

ExtentWidth

Gets a value that contains the horizontal size of the extent.

Declaration
public double ExtentWidth { get; }
Property Value
Type Description
System.Double

A System.Double that represents the horizontal size of the extent, in pixels. The default is 0.

| Improve this Doc View Source

HasLogicalOrientation

Gets a value that indicates if this VirtualizingStackPanel has a vertical or horizontal orientation.

Declaration
protected override bool HasLogicalOrientation { get; }
Property Value
Type Description
System.Boolean

This property always returns true.

Overrides
Panel.HasLogicalOrientation
| Improve this Doc View Source

HorizontalOffset

Gets a value that contains the horizontal offset of the scrolled content.

Declaration
public double HorizontalOffset { get; }
Property Value
Type Description
System.Double

A System.Double that represents the horizontal offset of the scrolled content, in pixels. The default is 0.

| Improve this Doc View Source

LogicalOrientation

Gets a value that represents the Orientation of the VirtualizingStackPanel.

Declaration
protected override Orientation LogicalOrientation { get; }
Property Value
Type Description
Orientation

An Orientation value.

Overrides
Panel.LogicalOrientation
| Improve this Doc View Source

Orientation

Gets or sets a value that describes the horizontal or vertical orientation of stacked content. The default is Vertical.

Declaration
public Orientation Orientation { get; set; }
Property Value
Type Description
Orientation
| Improve this Doc View Source

ScrollOwner

Gets or sets a value that identifies the container that controls scrolling behavior in this VirtualizingStackPanel.

Declaration
public ScrollViewer ScrollOwner { get; set; }
Property Value
Type Description
ScrollViewer

The ScrollViewer that owns scrolling for this VirtualizingStackPanel.

| Improve this Doc View Source

VerticalOffset

Gets a value that represents how far down the content is currently scrolled.

Declaration
public double VerticalOffset { get; }
Property Value
Type Description
System.Double

A System.Double that represents the vertical offset of the scrolled content, in pixels. The default is 0.

| Improve this Doc View Source

ViewportHeight

Gets a value that contains the vertical size of the viewport (visible area) of the content.

Declaration
public double ViewportHeight { get; }
Property Value
Type Description
System.Double

A System.Double that represents the vertical size of the viewport (visible area) of the content, in pixels. The default is 0.

| Improve this Doc View Source

ViewportWidth

Gets a value that contains the horizontal size of the viewport (visible area) of the content.

Declaration
public double ViewportWidth { get; }
Property Value
Type Description
System.Double

A System.Double that represents the vertical size of the viewport (visible area) of the content, in pixels. The default is 0.

Methods

| Improve this Doc View Source

ArrangeOverride(Size)

Arranges the content of a VirtualizingStackPanel element.

Declaration
protected override Size ArrangeOverride(Size arrangeSize)
Parameters
Type Name Description
Size arrangeSize

The Size that this element should use to arrange its child elements.

Returns
Type Description
Size

The Size that represents the arranged size of this VirtualizingStackPanel element and its child elements.

Overrides
FrameworkElement.ArrangeOverride(Size)
| Improve this Doc View Source

BringIndexIntoView(Int32)

Generates the item at the specified index and calls BringIntoView on it.

Declaration
protected override void BringIndexIntoView(int index)
Parameters
Type Name Description
System.Int32 index

Specify the item index that should become visible. This is the index into Items collection.

Overrides
VirtualizingPanel.BringIndexIntoView(Int32)
| Improve this Doc View Source

GetIsVirtualizing(DependencyObject)

Gets a value that determines whether the VirtualizingStackPanel is virtualizing its content.

Declaration
public static bool GetIsVirtualizing(DependencyObject o)
Parameters
Type Name Description
DependencyObject o

The object being virtualized.

Returns
Type Description
System.Boolean

true if the VirtualizingStackPanel is virtualizing its content; otherwise false.

Exceptions
Type Condition
System.ArgumentNullException

o is null.

| Improve this Doc View Source

GetVirtualizationMode(DependencyObject)

Returns the VirtualizationMode for the specified object.

Declaration
public static VirtualizationMode GetVirtualizationMode(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The object from which the VirtualizationMode is read.

Returns
Type Description
VirtualizationMode

One of the enumeration values that specifies whether the object uses container recycling.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

LineDown()

Scrolls content downward by one logical unit.

Declaration
public virtual void LineDown()
| Improve this Doc View Source

LineLeft()

Scrolls content to the left by one logical unit.

Declaration
public virtual void LineLeft()
| Improve this Doc View Source

LineRight()

Scrolls content to the right by one logical unit.

Declaration
public virtual void LineRight()
| Improve this Doc View Source

LineUp()

Scrolls content upward by one logical unit.

Declaration
public virtual void LineUp()
| Improve this Doc View Source

MakeVisible(UIElement, Rect)

Scrolls to the specified coordinates and makes that portion of a UIElement visible.

Declaration
public Rect MakeVisible(UIElement visual, Rect rectangle)
Parameters
Type Name Description
UIElement visual

The UIElement that becomes visible.

Rect rectangle

A Rect that represents the coordinate space within a UIElement.

Returns
Type Description
Rect

Rectangular area of the System.Windows.UIElement now visible.

| Improve this Doc View Source

MeasureOverride(Size)

Measures the child elements of a VirtualizingStackPanel in anticipation of arranging them during the ArrangeOverride(Size) pass.

Declaration
protected override Size MeasureOverride(Size constraint)
Parameters
Type Name Description
Size constraint

An upper limit Size that should not be exceeded.

Returns
Type Description
Size

The Size that represents the desired size of the element.

Overrides
FrameworkElement.MeasureOverride(Size)
| Improve this Doc View Source

MouseWheelDown()

Scrolls content logically downward in response to a downward click of the mouse wheel button.

Declaration
public virtual void MouseWheelDown()
| Improve this Doc View Source

MouseWheelLeft()

Scrolls content logically to the left in response to a left click of the mouse wheel button.

Declaration
public virtual void MouseWheelLeft()
| Improve this Doc View Source

MouseWheelRight()

Scrolls content logically to the right in response to a right click of the mouse wheel button.

Declaration
public virtual void MouseWheelRight()
| Improve this Doc View Source

MouseWheelUp()

Scrolls content logically upward in response to an upward click of the mouse wheel button.

Declaration
public virtual void MouseWheelUp()
| Improve this Doc View Source

OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)

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

Declaration
protected virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)
Parameters
Type Name Description
CleanUpVirtualizedItemEventArgs e

Data about the event.

| Improve this Doc View Source

OnClearChildren()

Called when the collection of child elements is cleared by the base Panel class.

Declaration
protected override void OnClearChildren()
Overrides
VirtualizingPanel.OnClearChildren()
| Improve this Doc View Source

OnItemsChanged(Object, ItemsChangedEventArgs)

Called when the Items collection that is associated with the ItemsControl for this Panel changes.

Declaration
protected override void OnItemsChanged(object sender, ItemsChangedEventArgs args)
Parameters
Type Name Description
System.Object sender

The System.Object that raised the event.

ItemsChangedEventArgs args

Provides data for the ItemsChanged event.

Overrides
VirtualizingPanel.OnItemsChanged(Object, ItemsChangedEventArgs)
| Improve this Doc View Source

PageDown()

Scrolls content downward by one page.

Declaration
public virtual void PageDown()
| Improve this Doc View Source

PageLeft()

Scrolls content to the left by one page.

Declaration
public virtual void PageLeft()
| Improve this Doc View Source

PageRight()

Scrolls content to the right by one page.

Declaration
public virtual void PageRight()
| Improve this Doc View Source

PageUp()

Scrolls content upward by one page.

Declaration
public virtual void PageUp()
| Improve this Doc View Source

SetHorizontalOffset(Double)

Sets the value of the HorizontalOffset property.

Declaration
public void SetHorizontalOffset(double offset)
Parameters
Type Name Description
System.Double offset

The value of the HorizontalOffset property.

| Improve this Doc View Source

SetVerticalOffset(Double)

Sets the value of the VerticalOffset property.

Declaration
public void SetVerticalOffset(double offset)
Parameters
Type Name Description
System.Double offset

The value of the VerticalOffset property.

| Improve this Doc View Source

SetVirtualizationMode(DependencyObject, VirtualizationMode)

Sets the VirtualizationMode on the specified object.

Declaration
public static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)
Parameters
Type Name Description
DependencyObject element

The element on which to set the VirtualizationMode.

VirtualizationMode value

One of the enumeration values that specifies whether element uses container recycling.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

Events

| Improve this Doc View Source

CleanUpVirtualizedItemEvent

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

Declaration
public event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEvent
Event Type
Type Description
CleanUpVirtualizedItemEventHandler

Implements

IScrollInfo

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source