Helper. Find Logical Node(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.
public static System.Windows.DependencyObject FindLogicalNode (System.Windows.DependencyObject logicalTreeNode, string elementName);
The name of the object to find.
The object with the matching name, if one is found; returns
null if no matching name was found in the logical tree.
The search direction for FindLogicalNode is toward child objects (down the tree); the search direction for the
FindNamemethods is towards parent objects (up the tree).
FindNamemethods are governed by the concept of a XAML namescope. Using
FindNameyou are guaranteed that only one object of that name exists, because XAML namescopes enforce uniqueness. In contrast, FindLogicalNode ignores XAML namescope and might cross XAML namescope boundaries during the search. As such, there is no guarantee of uniqueness of the
elementNamename once boundaries are crossed. For more information about XAML namescopes, see WPF XAML Namescopes.