Class LogicalTreeHelper
Provides static helper methods for querying objects in the logical tree.
Inheritance
Inherited Members
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public static class LogicalTreeHelper
Methods
| Improve this Doc View SourceFindLogicalNode(DependencyObject, String)
Attempts to find and return an object that has the specified name. The search starts from the specified object and continues into subnodes of the logical tree.
Declaration
public static DependencyObject FindLogicalNode(DependencyObject logicalTreeNode, string elementName)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | logicalTreeNode | The object to start searching from. |
| System.String | elementName | The name of the object to find. |
Returns
| Type | Description |
|---|---|
| DependencyObject | The object with the matching name, if one is found; returns null if no matching name was found in the logical tree. |
GetChildren(DependencyObject)
Returns the collection of immediate child objects of the specified object, by processing the logical tree.
Declaration
public static IEnumerable GetChildren(DependencyObject current)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | current | The object from which to start processing the logical tree. |
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerable | The enumerable collection of immediate child objects from the logical tree of the specified object. |
GetChildren(FrameworkElement)
Returns the collection of immediate child objects of the specified FrameworkElement by processing the logical tree.
Declaration
public static IEnumerable GetChildren(FrameworkElement current)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | current | The object from which to start processing the logical tree. |
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerable | The enumerable collection of immediate child objects starting from current in the logical tree. |
GetParent(DependencyObject)
Returns the parent object of the specified object by processing the logical tree.
Declaration
public static DependencyObject GetParent(DependencyObject current)
Parameters
| Type | Name | Description |
|---|---|---|
| DependencyObject | current | The object to find the parent object for. |
Returns
| Type | Description |
|---|---|
| DependencyObject | The requested parent object. |
GetParent(FrameworkElement)
Returns the parent object of the specified object by processing the logical tree.
Declaration
public static DependencyObject GetParent(FrameworkElement current)
Parameters
| Type | Name | Description |
|---|---|---|
| FrameworkElement | current | The object to find the parent object for. |
Returns
| Type | Description |
|---|---|
| DependencyObject | The requested parent object. |