Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    VisualTreeHelper Class

    Namespace: Stride.UI
    Assembly: Stride.UI.dll
    System.Object → VisualTreeHelper
    Derived from VisualTreeHelper:

    public static class VisualTreeHelper
    Name Description
    Methods
    FindVisualChildOfType<T>(UIElement, String)

    Find the first child that match the given type, along the visual tree.

    FindVisualChildrenOfType<T>(UIElement)

    Find all the children that match the given type, along the visual tree.

    FindVisualParentOfType<T>(UIElement)

    Find the first parent that match the given type, along the visual tree.

    FindVisualRoot(UIElement)

    Find the root parent, along the visual tree.

    | Improve this Doc View Source

    Methods


    FindVisualChildOfType<T>(UIElement, String)

    Find the first child that match the given type, along the visual tree.

    public static T FindVisualChildOfType<T>(this UIElement source, string name = null)
        where T : UIElement
    Parameters
    Type Name Description
    UIElement source

    Base node from where to start looking for child.

    System.String name

    (Optional) name of the element

    Returns
    Type Description
    T

    Returns the retrieved child, or null otherwise.

    Type Parameters
    Name Description
    T

    Type of child to find.


    FindVisualChildrenOfType<T>(UIElement)

    Find all the children that match the given type, along the visual tree.

    public static IEnumerable<T> FindVisualChildrenOfType<T>(this UIElement source)
        where T : UIElement
    Parameters
    Type Name Description
    UIElement source

    Base node from where to start looking for children.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<T>

    Returns the retrieved children, or empty otherwise.

    Type Parameters
    Name Description
    T

    Type of child to find.


    FindVisualParentOfType<T>(UIElement)

    Find the first parent that match the given type, along the visual tree.

    public static T FindVisualParentOfType<T>(this UIElement source)
        where T : UIElement
    Parameters
    Type Name Description
    UIElement source

    Base node from where to start looking for parent.

    Returns
    Type Description
    T

    Returns the retrieved parent, or null otherwise.

    Type Parameters
    Name Description
    T

    Type of parent to find.


    FindVisualRoot(UIElement)

    Find the root parent, along the visual tree.

    public static UIElement FindVisualRoot(this UIElement source)
    Parameters
    Type Name Description
    UIElement source

    Base node from where to start looking for root.

    Returns
    Type Description
    UIElement

    Returns the retrieved root, or null otherwise.


    • Improve this Doc
    • View Source
    In This Article

    Back to top

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