Class VirtualizingStackPanel
Arranges and virtualizes content on a single line that is oriented either horizontally or vertically.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class VirtualizingStackPanel : VirtualizingPanel, IScrollInfo
Constructors
| Improve this Doc View SourceVirtualizingStackPanel()
Initializes a new instance of the VirtualizingStackPanel class.
Declaration
public VirtualizingStackPanel()
Fields
| Improve this Doc View SourceIsVirtualizingProperty
A value that indicates whether the VirtualizingStackPanel is using virtualization.
Declaration
public static readonly DependencyProperty IsVirtualizingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
OrientationProperty
Identifies the Orientation dependency property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
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 SourceCanHorizontallyScroll
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. |
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. |
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. |
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. |
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. |
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 |
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. |
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. |
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. |
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 SourceArrangeOverride(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
| Improve this Doc View SourceGetIsVirtualizing(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. |
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. |
LineDown()
Scrolls content downward by one logical unit.
Declaration
public virtual void LineDown()
LineLeft()
Scrolls content to the left by one logical unit.
Declaration
public virtual void LineLeft()
LineRight()
Scrolls content to the right by one logical unit.
Declaration
public virtual void LineRight()
LineUp()
Scrolls content upward by one logical unit.
Declaration
public virtual void LineUp()
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. |
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
| Improve this Doc View SourceMouseWheelDown()
Scrolls content logically downward in response to a downward click of the mouse wheel button.
Declaration
public virtual void MouseWheelDown()
MouseWheelLeft()
Scrolls content logically to the left in response to a left click of the mouse wheel button.
Declaration
public virtual void MouseWheelLeft()
MouseWheelRight()
Scrolls content logically to the right in response to a right click of the mouse wheel button.
Declaration
public virtual void MouseWheelRight()
MouseWheelUp()
Scrolls content logically upward in response to an upward click of the mouse wheel button.
Declaration
public virtual void MouseWheelUp()
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. |
OnClearChildren()
Called when the collection of child elements is cleared by the base Panel class.
Declaration
protected override void OnClearChildren()
Overrides
| Improve this Doc View SourceOnItemsChanged(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
| Improve this Doc View SourcePageDown()
Scrolls content downward by one page.
Declaration
public virtual void PageDown()
PageLeft()
Scrolls content to the left by one page.
Declaration
public virtual void PageLeft()
PageRight()
Scrolls content to the right by one page.
Declaration
public virtual void PageRight()
PageUp()
Scrolls content upward by one page.
Declaration
public virtual void PageUp()
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. |
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. |
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 SourceCleanUpVirtualizedItemEvent
Occurs when an item that is hosted by the VirtualizingStackPanel is re-virtualized.
Declaration
public event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEvent
Event Type
Type | Description |
---|---|
CleanUpVirtualizedItemEventHandler |