Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    Panel Class

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

    Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects Stride applications.

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

    [DataContract("Panel")]
    [Display(null, "Panel")]
    public abstract class Panel : UIElement, IUIElementUpdate, IUIElementChildren, IIdentifiable, IScrollAnchorInfo
    Name Description
    Constructors
    Panel()

    Creates a new empty Panel.

    Fields
    PanelArrangeMatrixPropertyKey

    The key to the PanelArrangeMatrix dependency property. This property can be used by panels to arrange they children as they want.

    PanelChildrenSorter

    A instance of Panel.PanelChildrenComparer that can be used to sort panels children by increasing Z-Indices.

    ZIndexPropertyKey

    The key to the ZIndex dependency property.

    Properties
    Children

    Gets the UIElementCollection of child elements of this Panel.

    ScrollOwner
    Methods
    ActivateAnchoring(Orientation, Boolean)

    Change the anchoring activation state of the given direction.

    EnumerateChildren()

    Enumerates the children of this element.

    GetSurroudingAnchorDistances(Orientation, Single)
    LogicalChildrenChanged(Object, TrackingCollectionChangedEventArgs)

    Action to take when the Children collection is modified.

    OnLogicalChildAdded(UIElement, Int32)

    Action to perform when a logical child is added.

    OnLogicalChildRemoved(UIElement, Int32)

    Action to perform when a logical child is removed.

    ShouldAnchor(Orientation)
    UpdateWorldMatrix(ref Matrix, Boolean)
    | Improve this Doc View Source

    Constructors


    Panel()

    Creates a new empty Panel.

    protected Panel()
    | Improve this Doc View Source

    Fields


    PanelArrangeMatrixPropertyKey

    The key to the PanelArrangeMatrix dependency property. This property can be used by panels to arrange they children as they want.

    protected static readonly PropertyKey<Matrix> PanelArrangeMatrixPropertyKey
    Field Value
    Type Description
    PropertyKey<Matrix>

    PanelChildrenSorter

    A instance of Panel.PanelChildrenComparer that can be used to sort panels children by increasing Z-Indices.

    protected static readonly Panel.PanelChildrenComparer PanelChildrenSorter
    Field Value
    Type Description
    Panel.PanelChildrenComparer

    ZIndexPropertyKey

    The key to the ZIndex dependency property.

    [Display(null, "Appearance")]
    public static readonly PropertyKey<int> ZIndexPropertyKey
    Field Value
    Type Description
    PropertyKey<System.Int32>
    | Improve this Doc View Source

    Properties


    Children

    Gets the UIElementCollection of child elements of this Panel.

    [DataMember(DataMemberMode.Content)]
    public UIElementCollection Children { get; }
    Property Value
    Type Description
    UIElementCollection

    ScrollOwner

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

    Methods


    ActivateAnchoring(Orientation, Boolean)

    Change the anchoring activation state of the given direction.

    public void ActivateAnchoring(Orientation direction, bool enable)
    Parameters
    Type Name Description
    Orientation direction

    The direction in which activate or deactivate the anchoring

    System.Boolean enable

    true to enable anchoring, false to disable the anchoring


    EnumerateChildren()

    Enumerates the children of this element.

    protected override IEnumerable<IUIElementChildren> EnumerateChildren()
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<IUIElementChildren>

    A sequence containing all the children of this element.

    Overrides
    UIElement.EnumerateChildren()
    Remarks

    This method is used by the implementation of the IUIElementChildren interface.


    GetSurroudingAnchorDistances(Orientation, Single)

    public virtual Vector2 GetSurroudingAnchorDistances(Orientation direction, float position)
    Parameters
    Type Name Description
    Orientation direction
    System.Single position
    Returns
    Type Description
    Vector2

    LogicalChildrenChanged(Object, TrackingCollectionChangedEventArgs)

    Action to take when the Children collection is modified.

    protected void LogicalChildrenChanged(object sender, TrackingCollectionChangedEventArgs trackingCollectionChangedEventArgs)
    Parameters
    Type Name Description
    System.Object sender

    Sender of the event

    TrackingCollectionChangedEventArgs trackingCollectionChangedEventArgs

    Argument indicating what changed in the collection


    OnLogicalChildAdded(UIElement, Int32)

    Action to perform when a logical child is added.

    protected virtual void OnLogicalChildAdded(UIElement newElement, int index)
    Parameters
    Type Name Description
    UIElement newElement

    The element that has been added

    System.Int32 index

    The index in the collection where the child has been added


    OnLogicalChildRemoved(UIElement, Int32)

    Action to perform when a logical child is removed.

    protected virtual void OnLogicalChildRemoved(UIElement oldElement, int index)
    Parameters
    Type Name Description
    UIElement oldElement

    The element that has been removed

    System.Int32 index

    The index of the child removed in the collection


    ShouldAnchor(Orientation)

    public virtual bool ShouldAnchor(Orientation direction)
    Parameters
    Type Name Description
    Orientation direction
    Returns
    Type Description
    System.Boolean

    UpdateWorldMatrix(ref Matrix, Boolean)

    protected override void UpdateWorldMatrix(ref Matrix parentWorldMatrix, bool parentWorldChanged)
    Parameters
    Type Name Description
    Matrix parentWorldMatrix
    System.Boolean parentWorldChanged
    Overrides
    UIElement.UpdateWorldMatrix(ref Matrix, Boolean)

    Inherited Members

    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.HitableChildren
    UIElement.RenderOpacity
    UIElement.RenderSize
    UIElement.RenderOffsets
    UIElement.ActualWidth
    UIElement.ActualHeight
    UIElement.ActualDepth
    UIElement.IUIElementChildren.Children
    UIElement.Measure(Vector3)
    UIElement.MeasureOverride(Vector3)
    UIElement.Arrange(Vector3, Boolean)
    UIElement.ArrangeOverride(Vector3)
    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