Table of Contents

Class Panel

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.

[DataContract("Panel")]
[Display(null, "Panel")]
public abstract class Panel : UIElement, IUIElementUpdate, IUIElementChildren, IIdentifiable, IScrollAnchorInfo
Inheritance
Panel
Implements
Derived
Inherited Members
Extension Methods

Constructors

Panel()

Creates a new empty Panel.

protected Panel()

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

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

Panel.PanelChildrenComparer

ZIndexPropertyKey

The key to the ZIndex dependency property.

[Display(null, "Appearance")]
public static readonly PropertyKey<int> ZIndexPropertyKey

Field Value

PropertyKey<int>

Properties

Children

Gets the UIElementCollection of child elements of this Panel.

[DataMember(DataMemberMode.Content)]
public UIElementCollection Children { get; }

Property Value

UIElementCollection

ScrollOwner

Gets or sets a ScrollViewer element that controls scrolling behavior.

public ScrollViewer ScrollOwner { get; set; }

Property Value

ScrollViewer

Methods

ActivateAnchoring(Orientation, bool)

Change the anchoring activation state of the given direction.

public void ActivateAnchoring(Orientation direction, bool enable)

Parameters

direction Orientation

The direction in which activate or deactivate the anchoring

enable bool

true to enable anchoring, false to disable the anchoring

EnumerateChildren()

Enumerates the children of this element.

protected override IEnumerable<IUIElementChildren> EnumerateChildren()

Returns

IEnumerable<IUIElementChildren>

A sequence containing all the children of this element.

Remarks

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

GetSurroudingAnchorDistances(Orientation, float)

Get the distances to the previous and next anchors in the provided direction and from given position.

public virtual Vector2 GetSurroudingAnchorDistances(Orientation direction, float position)

Parameters

direction Orientation

The direction in which to anchor

position float

The current scrolling position

Returns

Vector2

The distances to previous and next anchors from to current scroll position

Remarks

The distance contained in the X component of the returned vector is inferior or equal to 0 and the distance contained in the Y component is superior or equal to 0.

LogicalChildrenChanged(object, TrackingCollectionChangedEventArgs)

Action to take when the Children collection is modified.

protected void LogicalChildrenChanged(object sender, TrackingCollectionChangedEventArgs trackingCollectionChangedEventArgs)

Parameters

sender object

Sender of the event

trackingCollectionChangedEventArgs TrackingCollectionChangedEventArgs

Argument indicating what changed in the collection

OnLogicalChildAdded(UIElement, int)

Action to perform when a logical child is added.

protected virtual void OnLogicalChildAdded(UIElement newElement, int index)

Parameters

newElement UIElement

The element that has been added

index int

The index in the collection where the child has been added

OnLogicalChildRemoved(UIElement, int)

Action to perform when a logical child is removed.

protected virtual void OnLogicalChildRemoved(UIElement oldElement, int index)

Parameters

oldElement UIElement

The element that has been removed

index int

The index of the child removed in the collection

ShouldAnchor(Orientation)

Indicate whether the ScrollViewer managing this element should snap scrolling to anchors in the provided direction.

public virtual bool ShouldAnchor(Orientation direction)

Parameters

direction Orientation

The direction in which to anchor

Returns

bool

UpdateWorldMatrix(ref Matrix, bool)

Method called by UpdateWorldMatrix(ref Matrix, bool). Parents are in charge of recursively calling this function on their children.

protected override void UpdateWorldMatrix(ref Matrix parentWorldMatrix, bool parentWorldChanged)

Parameters

parentWorldMatrix Matrix

The world matrix of the parent.

parentWorldChanged bool

Boolean indicating if the world matrix provided by the parent changed