Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.53 KB

textelement_findname_634111277.md

File metadata and controls

34 lines (22 loc) · 1.53 KB
-api-id -api-type
M:Windows.UI.Xaml.Documents.TextElement.FindName(System.String)
winrt method

Windows.UI.Xaml.Documents.TextElement.FindName

-description

Retrieves an object in the object model / runtime object graph by referencing the object's x:Name or Name attribute value.

-parameters

-param name

The name of the object to retrieve.

-returns

The object that has the specified name, or null if no object is retrieved.

-remarks

FrameworkElement is the class that implements Name support for most other run-time classes, but TextElement is not a FrameworkElement derived class. TextElement supports its own Name and FindName implementations, and the underlying logic for name lookup does not differentiate between TextElement and FrameworkElement. You can use the TextElement-implemented FindName to find a named FrameworkElement, and vice versa.

Because FindName relies on all the XAML sources being parsed for the Name attributes, you should not attempt to call FindName until the XAML is loaded.

Names and FindName are influenced by the concept of a XAML namescope.

-examples

-see-also