VisualTreeHelper Class
Namespace: Stride.UIAssembly: Stride.UI.dll
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. |
|
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. |