Panel Class
Namespace: Stride.UI.PanelsAssembly: 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
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) |
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
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> |
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 |
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 |
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
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 |