Class Panel
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
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
ZIndexPropertyKey
The key to the ZIndex dependency property.
[Display(null, "Appearance")]
public static readonly PropertyKey<int> ZIndexPropertyKey
Field Value
Properties
Children
Gets the UIElementCollection of child elements of this Panel.
[DataMember(DataMemberMode.Content)]
public UIElementCollection Children { get; }
Property Value
ScrollOwner
Gets or sets a ScrollViewer element that controls scrolling behavior.
public ScrollViewer ScrollOwner { get; set; }
Property Value
Methods
ActivateAnchoring(Orientation, bool)
Change the anchoring activation state of the given direction.
public void ActivateAnchoring(Orientation direction, bool enable)
Parameters
direction
OrientationThe direction in which activate or deactivate the anchoring
enable
booltrue 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
OrientationThe direction in which to anchor
position
floatThe 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
objectSender of the event
trackingCollectionChangedEventArgs
TrackingCollectionChangedEventArgsArgument 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
UIElementThe element that has been added
index
intThe 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
UIElementThe element that has been removed
index
intThe 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
OrientationThe direction in which to anchor
Returns
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)