StackPanel Class
Namespace: Stride.UI.PanelsAssembly: Stride.UI.dll
Arranges child elements into a single line that can be oriented horizontally or vertically.
[DataContract("StackPanel")]
public class StackPanel : Panel, IUIElementUpdate, IUIElementChildren, IIdentifiable, IScrollAnchorInfo, IScrollInfo
Name | Description | |
---|---|---|
Fields | ||
OrientationToMaximizeIndex1 | Indicate the first index of Vector3 to use to maximize depending on the stack panel orientation. |
|
OrientationToMaximizeIndex2 | Indicate the second index of Vector3 to use to accumulate depending on the stack panel orientation. |
|
ScrollingModeToInfiniteAxis | Indicate the axis along which the measure zone is infinite depending on the scroll owner scrolling mode. |
|
Properties | ||
Extent | ||
HitableChildren | ||
ItemVirtualizationEnabled | Gets or sets the value indicating if the StackPanel children must be virtualized or not. When children virtualization is activated, hidden children's measurement, arrangement and draw are avoided. |
|
Offset | ||
Orientation | Gets or sets a value that indicates the orientation by which child elements are stacked. |
|
ScrollBarPositions | ||
ScrollPosition | The current scroll position of the left/top corner of the stack panel. |
|
Viewport | ||
Methods | ||
ArrangeOverride(Vector3) | ||
CanScroll(Orientation) | ||
GetSurroudingAnchorDistances(Orientation, Single) | ||
MeasureOverride(Vector3) | ||
OnLogicalChildAdded(UIElement, Int32) | ||
OnLogicalChildRemoved(UIElement, Int32) | ||
ScrolllToElement(Single) | Jump to the element having the provided index. |
|
ScrollOf(Vector3) | ||
ScrollOf(Single) | Scroll of the provided offset from the current position in the direction given by the stack panel Orientation . |
|
ScrollToBeginning() | Scroll to the beginning of the StackPanel. |
|
ScrollToBeginning(Orientation) | ||
ScrollToEnd() | Scroll to the end of the StackPanel. |
|
ScrollToEnd(Orientation) | ||
ScrollToNextLine() | Scroll to the next element of the StackPanel. |
|
ScrollToNextLine(Orientation) | ||
ScrollToNextPage() | Scroll to the next page of elements of the StackPanel. |
|
ScrollToNextPage(Orientation) | ||
ScrollToPreviousLine() | Scroll to the previous element of the StackPanel. |
|
ScrollToPreviousLine(Orientation) | ||
ScrollToPreviousPage() | Scroll to the previous page of elements of the StackPanel. |
|
ScrollToPreviousPage(Orientation) |
Fields
OrientationToMaximizeIndex1
Indicate the first index of Vector3 to use to maximize depending on the stack panel orientation.
protected static readonly int[] OrientationToMaximizeIndex1
Field Value
Type | Description |
---|---|
System.Int32[] |
OrientationToMaximizeIndex2
Indicate the second index of Vector3 to use to accumulate depending on the stack panel orientation.
protected static readonly int[] OrientationToMaximizeIndex2
Field Value
Type | Description |
---|---|
System.Int32[] |
ScrollingModeToInfiniteAxis
Indicate the axis along which the measure zone is infinite depending on the scroll owner scrolling mode.
protected static readonly List<int[]> ScrollingModeToInfiniteAxis
Field Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32[]> |
Properties
Extent
public Vector3 Extent { get; }
Property Value
Type | Description |
---|---|
Vector3 |
HitableChildren
protected override FastCollection<UIElement> HitableChildren { get; }
Property Value
Type | Description |
---|---|
FastCollection<UIElement> |
Overrides
ItemVirtualizationEnabled
Gets or sets the value indicating if the StackPanel children must be virtualized or not. When children virtualization is activated, hidden children's measurement, arrangement and draw are avoided.
[DataMember]
[Display(null, "Behavior")]
public bool ItemVirtualizationEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Offset
public Vector3 Offset { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Orientation
Gets or sets a value that indicates the orientation by which child elements are stacked.
[DataMember]
[Display(null, "Layout")]
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation |
ScrollBarPositions
public Vector3 ScrollBarPositions { get; }
Property Value
Type | Description |
---|---|
Vector3 |
ScrollPosition
The current scroll position of the left/top corner of the stack panel.
public float ScrollPosition { get; }
Property Value
Type | Description |
---|---|
System.Single |
Remarks
The stack panel scroll position is expressed element index units. For example: 0 represents the first element, 1 represents the second element, 1.33 represents a third of the second element, etc...
Viewport
public Vector3 Viewport { get; }
Property Value
Type | Description |
---|---|
Vector3 |
Methods
ArrangeOverride(Vector3)
protected override Vector3 ArrangeOverride(Vector3 finalSizeWithoutMargins)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | finalSizeWithoutMargins |
Returns
Type | Description |
---|---|
Vector3 |
Overrides
CanScroll(Orientation)
public bool CanScroll(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
Returns
Type | Description |
---|---|
System.Boolean |
GetSurroudingAnchorDistances(Orientation, Single)
public override Vector2 GetSurroudingAnchorDistances(Orientation direction, float position)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction | |
System.Single | position |
Returns
Type | Description |
---|---|
Vector2 |
Overrides
MeasureOverride(Vector3)
protected override Vector3 MeasureOverride(Vector3 availableSizeWithoutMargins)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | availableSizeWithoutMargins |
Returns
Type | Description |
---|---|
Vector3 |
Overrides
OnLogicalChildAdded(UIElement, Int32)
protected override void OnLogicalChildAdded(UIElement newElement, int index)
Parameters
Type | Name | Description |
---|---|---|
UIElement | newElement | |
System.Int32 | index |
Overrides
OnLogicalChildRemoved(UIElement, Int32)
protected override void OnLogicalChildRemoved(UIElement oldElement, int index)
Parameters
Type | Name | Description |
---|---|---|
UIElement | oldElement | |
System.Int32 | index |
Overrides
ScrolllToElement(Single)
Jump to the element having the provided index.
public void ScrolllToElement(float elementIndex)
Parameters
Type | Name | Description |
---|---|---|
System.Single | elementIndex | The index (0-based) of the element in the stack panel to jump to |
ScrollOf(Vector3)
public void ScrollOf(Vector3 offsetsToApply)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | offsetsToApply |
ScrollOf(Single)
Scroll of the provided offset from the current position in the direction given by the stack panel Orientation .
public void ScrollOf(float offsetToApply)
Parameters
Type | Name | Description |
---|---|---|
System.Single | offsetToApply | The value to scroll off |
ScrollToBeginning()
Scroll to the beginning of the StackPanel.
public void ScrollToBeginning()
Remarks
Equivalent to ScrollToBeginning(Orientation) called with the value Orientation
ScrollToBeginning(Orientation)
public void ScrollToBeginning(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
ScrollToEnd()
Scroll to the end of the StackPanel.
public void ScrollToEnd()
Remarks
Equivalent to ScrollToEnd(Orientation) called with the value Orientation
ScrollToEnd(Orientation)
public void ScrollToEnd(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
ScrollToNextLine()
Scroll to the next element of the StackPanel.
public void ScrollToNextLine()
Remarks
Equivalent to ScrollToNextLine(Orientation) called with the value Orientation
ScrollToNextLine(Orientation)
public void ScrollToNextLine(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
ScrollToNextPage()
Scroll to the next page of elements of the StackPanel.
public void ScrollToNextPage()
Remarks
Equivalent to ScrollToNextPage(Orientation) called with the value Orientation
ScrollToNextPage(Orientation)
public void ScrollToNextPage(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
ScrollToPreviousLine()
Scroll to the previous element of the StackPanel.
public void ScrollToPreviousLine()
Remarks
Equivalent to ScrollToPreviousLine(Orientation) called with the value Orientation
ScrollToPreviousLine(Orientation)
public void ScrollToPreviousLine(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |
ScrollToPreviousPage()
Scroll to the previous page of elements of the StackPanel.
public void ScrollToPreviousPage()
Remarks
Equivalent to ScrollToPreviousPage(Orientation) called with the value Orientation
ScrollToPreviousPage(Orientation)
public void ScrollToPreviousPage(Orientation direction)
Parameters
Type | Name | Description |
---|---|---|
Orientation | direction |