Attempts to find and return an element node that has the specified name. The search starts from the specified element and continues into subnodes.
Assembly: PresentationFramework (in PresentationFramework.dll)
public static DependencyObject FindLogicalNode( DependencyObject logicalTreeNode, string elementName )
- Type: System.Windows.DependencyObject
- Type: System.String
The name of the element node to find.
Return ValueType: System.Windows.DependencyObject
The element with the matching name, if one is found; returns null if no matching name was found in the active namescope.
The search direction for is toward child elements; the search direction for the FindName methods is toward parent elements.
The FindName methods are governed by the concept of a namescope. Using FindName you are guaranteed that only one element of that name exists, because namescopes enforce uniqueness. In contrast, ignores namescope and might cross namescope boundaries during the search. As such, there is no guarantee of uniqueness of name once boundaries are crossed. For more information about namescopes, see WPF XAML Namescopes.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.