Table of Contents

Class UIElementExtensions

Namespace
Stride.UI
Assembly
Stride.UI.dll

Extensions methods for UIElement

public static class UIElementExtensions
Inheritance
UIElementExtensions

Methods

GetCanvasAbsolutePosition(UIElement)

Gets the absolute position of the element into its parent canvas. The position is in virtual pixels.

public static Vector3 GetCanvasAbsolutePosition(this UIElement element)

Parameters

element UIElement

The element

Returns

Vector3

The absolute position of the element into its parent canvas

Remarks

Equivalent to get the AbsolutePositionPropertyKey of the element

GetCanvasPinOrigin(UIElement)

Gets the origin of the element used when pinning it into its parent canvas. This value is normalized between [0,1]. (0,0,0) represents the left/top/back corner, (1,1,1) represents the right/bottom/front corner, etc...

public static Vector3 GetCanvasPinOrigin(this UIElement element)

Parameters

element UIElement

The element

Returns

Vector3

The pin origin of the element

Remarks

Equivalent to get the PinOriginPropertyKey of the element

GetCanvasRelativePosition(UIElement)

Gets the relative position of the element into its parent canvas. Position is normalized between [0,1].

public static Vector3 GetCanvasRelativePosition(this UIElement element)

Parameters

element UIElement

The element

Returns

Vector3

The relative position of the element into its parent canvas

Remarks

Equivalent to get the RelativePositionPropertyKey of the element

GetCanvasRelativeSize(UIElement)

Gets the relative position of the element with respect to its parent canvas. float.NaN when not specified.

public static Vector3 GetCanvasRelativeSize(this UIElement element)

Parameters

element UIElement

The element

Returns

Vector3

The relative position of the element to its parent canvas

Remarks

Equivalent to get the RelativeSizePropertyKey of the element

GetGridColumn(UIElement)

Gets the column index of the grid in which resides the element.

public static int GetGridColumn(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The 0-based column index of the element

Remarks

Equivalent to get the ColumnPropertyKey of the element

GetGridColumnSpan(UIElement)

Gets the number of column spans that the element occupies in the grid.

public static int GetGridColumnSpan(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The number column of spans occupied by the element

Remarks

Equivalent to get the ColumnSpanPropertyKey of the element

GetGridLayer(UIElement)

Gets the layer index of the grid in which resides the element.

public static int GetGridLayer(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The 0-based layer index of the element

Remarks

Equivalent to get the LayerPropertyKey of the element

GetGridLayerSpan(UIElement)

Gets the number of layer spans that the element occupies in the grid.

public static int GetGridLayerSpan(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The number of layer spans occupied by the element

Remarks

Equivalent to get the LayerSpanPropertyKey of the element

GetGridRow(UIElement)

Gets the row index of the grid in which resides the element.

public static int GetGridRow(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The 0-based row index of the element

Remarks

Equivalent to get the RowPropertyKey of the element

GetGridRowSpan(UIElement)

Gets the number of row spans that the element occupies in the grid.

public static int GetGridRowSpan(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The number of row spans occupied by the element

Remarks

Equivalent to get the RowSpanPropertyKey of the element

GetPanelZIndex(UIElement)

Sets the Panel Z-index value for this element. The Panel Z-index value is used to determine which child of a same panel should be drawn on top.

public static int GetPanelZIndex(this UIElement element)

Parameters

element UIElement

The element

Returns

int

The Panel Z-index value of the element

Remarks

Equivalent to get the ZIndexPropertyKey of the element

SetCanvasAbsolutePosition(UIElement, Vector3)

Sets the absolute position of the element into its parent canvas.

public static void SetCanvasAbsolutePosition(this UIElement element, Vector3 position)

Parameters

element UIElement

The element

position Vector3

The absolute position in virtual pixels

Remarks

Equivalent to set the AbsolutePositionPropertyKey of the element

SetCanvasPinOrigin(UIElement, Vector3)

Sets the origin of the element used when pinning it into its parent canvas. This value is normalized between [0,1]. (0,0,0) represents the left/top/back corner, (1,1,1) represents the right/bottom/front corner, etc...

public static void SetCanvasPinOrigin(this UIElement element, Vector3 origin)

Parameters

element UIElement

The element

origin Vector3

The pin origin value

Remarks

Equivalent to set the PinOriginPropertyKey of the element

SetCanvasRelativePosition(UIElement, Vector3)

Sets the relative position of the element into its parent canvas.

public static void SetCanvasRelativePosition(this UIElement element, Vector3 position)

Parameters

element UIElement

The element

position Vector3

The relative position normalized between [0,1]

Remarks

Equivalent to set the RelativePositionPropertyKey of the element

SetCanvasRelativeSize(UIElement, Vector3)

Sets the relative position of the element with respect to its parent canvas. Set the value of any component to float.NaN to let the element measure itself in this axis.

public static void SetCanvasRelativeSize(this UIElement element, Vector3 size)

Parameters

element UIElement

The element

size Vector3

The relative position of the element

Remarks

Equivalent to set the RelativeSizePropertyKey of the element

SetGridColumn(UIElement, int)

Sets the column index of the grid in which resides the element.

public static void SetGridColumn(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The 0-based column index

Remarks

Equivalent to set the ColumnPropertyKey of the element

SetGridColumnSpan(UIElement, int)

Sets the number of column spans that the element occupies in the grid.

public static void SetGridColumnSpan(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The number of column spans occupied

Remarks

Equivalent to set the ColumnSpanPropertyKey of the element

SetGridLayer(UIElement, int)

Sets the layer index of the grid in which resides the element.

public static void SetGridLayer(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The 0-based layer index

Remarks

Equivalent to set the LayerPropertyKey of the element

SetGridLayerSpan(UIElement, int)

Sets the number of layer spans that the element occupies in the grid.

public static void SetGridLayerSpan(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The number of layer spans occupied

Remarks

Equivalent to set the LayerSpanPropertyKey of the element

SetGridRow(UIElement, int)

Sets the row index of the grid in which resides the element.

public static void SetGridRow(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The 0-based row index

Remarks

Equivalent to set the RowPropertyKey of the element

SetGridRowSpan(UIElement, int)

Sets the number of row spans that the element occupies in the grid.

public static void SetGridRowSpan(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The number of row spans occupied

Remarks

Equivalent to set the RowSpanPropertyKey of the element

SetPanelZIndex(UIElement, int)

Sets the Panel Z-index value for this element. The Panel Z-index value is used to determine which child of a same panel should be drawn on top.

public static void SetPanelZIndex(this UIElement element, int index)

Parameters

element UIElement

The element

index int

The Panel Z-index value

Remarks

Equivalent to set the ZIndexPropertyKey of the element