Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    UIElementExtensions Class

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

    Extensions methods for UIElement

    System.Object → UIElementExtensions
    Derived from UIElementExtensions:

    public static class UIElementExtensions
    Name Description
    Methods
    GetCanvasAbsolutePosition(UIElement)

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

    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...

    GetCanvasRelativePosition(UIElement)

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

    GetCanvasRelativeSize(UIElement)

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

    GetGridColumn(UIElement)

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

    GetGridColumnSpan(UIElement)

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

    GetGridLayer(UIElement)

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

    GetGridLayerSpan(UIElement)

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

    GetGridRow(UIElement)

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

    GetGridRowSpan(UIElement)

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

    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.

    SetCanvasAbsolutePosition(UIElement, Vector3)

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

    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...

    SetCanvasRelativePosition(UIElement, Vector3)

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

    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.

    SetGridColumn(UIElement, Int32)

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

    SetGridColumnSpan(UIElement, Int32)

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

    SetGridLayer(UIElement, Int32)

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

    SetGridLayerSpan(UIElement, Int32)

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

    SetGridRow(UIElement, Int32)

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

    SetGridRowSpan(UIElement, Int32)

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

    SetPanelZIndex(UIElement, Int32)

    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.

    | Improve this Doc View Source

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Returns
    Type Description
    System.Int32

    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
    Type Name Description
    UIElement element

    The element

    Vector3 position

    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
    Type Name Description
    UIElement element

    The element

    Vector3 origin

    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
    Type Name Description
    UIElement element

    The element

    Vector3 position

    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
    Type Name Description
    UIElement element

    The element

    Vector3 size

    The relative position of the element

    Remarks

    Equivalent to set the RelativeSizePropertyKey of the element


    SetGridColumn(UIElement, Int32)

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

    public static void SetGridColumn(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The 0-based column index

    Remarks

    Equivalent to set the ColumnPropertyKey of the element


    SetGridColumnSpan(UIElement, Int32)

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

    public static void SetGridColumnSpan(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The number of column spans occupied

    Remarks

    Equivalent to set the ColumnSpanPropertyKey of the element


    SetGridLayer(UIElement, Int32)

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

    public static void SetGridLayer(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The 0-based layer index

    Remarks

    Equivalent to set the LayerPropertyKey of the element


    SetGridLayerSpan(UIElement, Int32)

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

    public static void SetGridLayerSpan(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The number of layer spans occupied

    Remarks

    Equivalent to set the LayerSpanPropertyKey of the element


    SetGridRow(UIElement, Int32)

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

    public static void SetGridRow(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The 0-based row index

    Remarks

    Equivalent to set the RowPropertyKey of the element


    SetGridRowSpan(UIElement, Int32)

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

    public static void SetGridRowSpan(this UIElement element, int index)
    Parameters
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The number of row spans occupied

    Remarks

    Equivalent to set the RowSpanPropertyKey of the element


    SetPanelZIndex(UIElement, Int32)

    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
    Type Name Description
    UIElement element

    The element

    System.Int32 index

    The Panel Z-index value

    Remarks

    Equivalent to set the ZIndexPropertyKey of the element


    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation