Show / Hide Table of Contents

Class LogicalTreeHelper

Provides static helper methods for querying objects in the logical tree.

Inheritance
System.Object
LogicalTreeHelper
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public static class LogicalTreeHelper

Methods

| Improve this Doc View Source

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

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source