Class LogicalTree
Defines a collection of extensions methods for UI.
Inheritance
Namespace: Syncfusion.UI.Xaml.Core
Assembly: Syncfusion.Core.WinUI.dll
Syntax
public static class LogicalTree : Object
Methods
FindChild<T>(FrameworkElement)
Find first logical child control of a specified type.
Declaration
public static T FindChild<T>(this FrameworkElement element)
where T : FrameworkElement
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Parent element. |
Returns
Type | Description |
---|---|
T | Child control or null if not found. |
Type Parameters
Name | Description |
---|---|
T | Type to search for. |
FindChildByName(FrameworkElement, String)
Find logical child control using its name.
Declaration
public static FrameworkElement FindChildByName(this FrameworkElement element, string name)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Parent element. |
System.String | name | Name of the control to find. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.FrameworkElement | Child control or null if not found. |
FindChildren<T>(FrameworkElement)
Find all logical child controls of the specified type.
Declaration
public static IEnumerable<T> FindChildren<T>(this FrameworkElement element)
where T : FrameworkElement
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Parent element. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | Child controls or empty if not found. |
Type Parameters
Name | Description |
---|---|
T | Type to search for. |
FindParent<T>(FrameworkElement)
Find first logical parent control of a specified type.
Declaration
public static T FindParent<T>(this FrameworkElement element)
where T : FrameworkElement
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Child element. |
Returns
Type | Description |
---|---|
T | Parent control or null if not found. |
Type Parameters
Name | Description |
---|---|
T | Type to search for. |
FindParentByName(FrameworkElement, String)
Finds the logical parent element with the given name or returns null.
Declaration
public static FrameworkElement FindParentByName(this FrameworkElement element, string name)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Child element. |
System.String | name | Name of the control to find. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.FrameworkElement | Parent control or null if not found. |
GetContentControl(FrameworkElement)
Retrieves the Content control of this element as defined by the ContentPropertyAttribute.
Declaration
public static UIElement GetContentControl(this FrameworkElement element)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.FrameworkElement | element | Parent element. |
Returns
Type | Description |
---|---|
Microsoft.UI.Xaml.UIElement | Child Content control or null if not available. |