Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    StackPanel Class

    Namespace: Stride.UI.Panels
    Assembly: Stride.UI.dll

    Arranges child elements into a single line that can be oriented horizontally or vertically.

    System.Object → UIElement → Panel → StackPanel
    Derived from StackPanel:

    [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)
    | Improve this Doc View Source

    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[]>
    | Improve this Doc View Source

    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
    UIElement.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.

    [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
    | Improve this Doc View Source

    Methods


    ArrangeOverride(Vector3)

    protected override Vector3 ArrangeOverride(Vector3 finalSizeWithoutMargins)
    Parameters
    Type Name Description
    Vector3 finalSizeWithoutMargins
    Returns
    Type Description
    Vector3
    Overrides
    UIElement.ArrangeOverride(Vector3)

    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
    Panel.GetSurroudingAnchorDistances(Orientation, Single)

    MeasureOverride(Vector3)

    protected override Vector3 MeasureOverride(Vector3 availableSizeWithoutMargins)
    Parameters
    Type Name Description
    Vector3 availableSizeWithoutMargins
    Returns
    Type Description
    Vector3
    Overrides
    UIElement.MeasureOverride(Vector3)

    OnLogicalChildAdded(UIElement, Int32)

    protected override void OnLogicalChildAdded(UIElement newElement, int index)
    Parameters
    Type Name Description
    UIElement newElement
    System.Int32 index
    Overrides
    Panel.OnLogicalChildAdded(UIElement, Int32)

    OnLogicalChildRemoved(UIElement, Int32)

    protected override void OnLogicalChildRemoved(UIElement oldElement, int index)
    Parameters
    Type Name Description
    UIElement oldElement
    System.Int32 index
    Overrides
    Panel.OnLogicalChildRemoved(UIElement, Int32)

    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

    Inherited Members

    Panel.ZIndexPropertyKey
    Panel.PanelArrangeMatrixPropertyKey
    Panel.PanelChildrenSorter
    Panel.Children
    Panel.EnumerateChildren()
    Panel.LogicalChildrenChanged(Object, TrackingCollectionChangedEventArgs)
    Panel.UpdateWorldMatrix(Matrix, Boolean)
    Panel.ActivateAnchoring(Orientation, Boolean)
    Panel.ShouldAnchor(Orientation)
    Panel.ScrollOwner
    UIElement.InputCategory
    UIElement.PanelCategory
    UIElement.AppearanceCategory
    UIElement.BehaviorCategory
    UIElement.LayoutCategory
    UIElement.MiscCategory
    UIElement.MarginInternal
    UIElement.ArrangeChanged
    UIElement.LocalMatrixChanged
    UIElement.Id
    UIElement.DependencyProperties
    UIElement.LocalMatrix
    UIElement.BackgroundColor
    UIElement.Opacity
    UIElement.Visibility
    UIElement.ClipToBounds
    UIElement.DrawLayerNumber
    UIElement.IsEnabled
    UIElement.CanBeHitByUser
    UIElement.Width
    UIElement.Height
    UIElement.Depth
    UIElement.Size
    UIElement.HorizontalAlignment
    UIElement.VerticalAlignment
    UIElement.DepthAlignment
    UIElement.Margin
    UIElement.MinimumWidth
    UIElement.MinimumHeight
    UIElement.MinimumDepth
    UIElement.MaximumWidth
    UIElement.MaximumHeight
    UIElement.MaximumDepth
    UIElement.DefaultWidth
    UIElement.DefaultHeight
    UIElement.DefaultDepth
    UIElement.Name
    UIElement.DesiredSize
    UIElement.DesiredSizeWithMargins
    UIElement.IsArrangeValid
    UIElement.IsMeasureValid
    UIElement.WorldMatrix
    UIElement.DepthBias
    UIElement.LayoutingContext
    UIElement.VisualChildrenCollection
    UIElement.InvalidateArrange()
    UIElement.InvalidateMeasure()
    UIElement.OnNameChanged()
    UIElement.IsHierarchyEnabled
    UIElement.IsVisible
    UIElement.IsCollapsed
    UIElement.Parent
    UIElement.VisualParent
    UIElement.VisualChildren
    UIElement.RenderOpacity
    UIElement.RenderSize
    UIElement.RenderOffsets
    UIElement.ActualWidth
    UIElement.ActualHeight
    UIElement.ActualDepth
    UIElement.IUIElementChildren.Children
    UIElement.Measure(Vector3)
    UIElement.Arrange(Vector3, Boolean)
    UIElement.CollapseOverride()
    UIElement.PropagateCollapseToChild(UIElement)
    UIElement.FindName(String)
    UIElement.SetParent(UIElement, UIElement)
    UIElement.SetVisualParent(UIElement, UIElement)
    UIElement.Intersects(Ray, Vector3)
    UIElement.IUIElementUpdate.Update(GameTime)
    UIElement.IUIElementUpdate.UpdateWorldMatrix(Matrix, Boolean)
    UIElement.IUIElementUpdate.UpdateElementState(Int32)
    UIElement.Update(GameTime)
    UIElement.CalculateSizeWithThickness(Vector3, Thickness)
    UIElement.CalculateSizeWithoutThickness(Vector3, Thickness)
    UIElement.CalculateAdjustmentOffsets(Thickness, Vector3, Vector3)
    UIElement.IsTouched
    UIElement.MouseOverState
    UIElement.RequiresMouseOverUpdate
    UIElement.RaiseEvent(RoutedEventArgs)
    UIElement.AddHandler<T>(RoutedEvent<T>, EventHandler<T>, Boolean)
    UIElement.RemoveHandler<T>(RoutedEvent<T>, EventHandler<T>)
    UIElement.MouseOverStateChanged
    UIElement.PreviewTouchDown
    UIElement.PreviewTouchMove
    UIElement.PreviewTouchUp
    UIElement.TouchDown
    UIElement.TouchEnter
    UIElement.TouchLeave
    UIElement.TouchMove
    UIElement.TouchUp
    UIElement.OnPreviewTouchDown(TouchEventArgs)
    UIElement.OnPreviewTouchMove(TouchEventArgs)
    UIElement.OnPreviewTouchUp(TouchEventArgs)
    UIElement.OnTouchDown(TouchEventArgs)
    UIElement.OnTouchEnter(TouchEventArgs)
    UIElement.OnTouchLeave(TouchEventArgs)
    UIElement.OnTouchMove(TouchEventArgs)
    UIElement.OnTouchUp(TouchEventArgs)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    UIElementExtensions.SetPanelZIndex(UIElement, Int32)
    UIElementExtensions.GetPanelZIndex(UIElement)
    UIElementExtensions.SetCanvasRelativeSize(UIElement, Vector3)
    UIElementExtensions.GetCanvasRelativeSize(UIElement)
    UIElementExtensions.SetCanvasRelativePosition(UIElement, Vector3)
    UIElementExtensions.GetCanvasRelativePosition(UIElement)
    UIElementExtensions.SetCanvasAbsolutePosition(UIElement, Vector3)
    UIElementExtensions.GetCanvasAbsolutePosition(UIElement)
    UIElementExtensions.SetCanvasPinOrigin(UIElement, Vector3)
    UIElementExtensions.GetCanvasPinOrigin(UIElement)
    UIElementExtensions.SetGridColumn(UIElement, Int32)
    UIElementExtensions.GetGridColumn(UIElement)
    UIElementExtensions.SetGridRow(UIElement, Int32)
    UIElementExtensions.GetGridRow(UIElement)
    UIElementExtensions.SetGridLayer(UIElement, Int32)
    UIElementExtensions.GetGridLayer(UIElement)
    UIElementExtensions.SetGridColumnSpan(UIElement, Int32)
    UIElementExtensions.GetGridColumnSpan(UIElement)
    UIElementExtensions.SetGridRowSpan(UIElement, Int32)
    UIElementExtensions.GetGridRowSpan(UIElement)
    UIElementExtensions.SetGridLayerSpan(UIElement, Int32)
    UIElementExtensions.GetGridLayerSpan(UIElement)
    VisualTreeHelper.FindVisualChildOfType<T>(UIElement, String)
    VisualTreeHelper.FindVisualChildrenOfType<T>(UIElement)
    VisualTreeHelper.FindVisualParentOfType<T>(UIElement)
    VisualTreeHelper.FindVisualRoot(UIElement)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation