Finds an element that has the provided identifier name.
Assembly: PresentationFramework (in PresentationFramework.dll)
If the element has child elements, these child elements are all searched recursively for the requested named element.
operates within the current element's namescope. For details, see WPF XAML Namescopes.
This example describes how to use the method to find an element by its Name value.
In this example, the method to find a particular element by its name is written as the event handler of a button. stackPanel is the Name of the root FrameworkElement being searched, and the example method then visually indicates the found element by casting it as TextBlock and changing one of the TextBlock visible UI properties.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2