FrameworkElementAutomationPeer.GetNameCore Method

July 28, 2014

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Returns the UI Automation Name from the element that is associated with this FrameworkElementAutomationPeer. This method is called by GetName.

Namespace:  System.Windows.Automation.Peers
Assembly:  System.Windows (in System.Windows.dll)

protected override string GetNameCore()

Return Value

Type: System.String
The UI Automation Name from the element that is associated with this automation peer.

The value is settable on instances through the AutomationProperties.Name attached property. The element does not need to be a control to carry a UI Automation Name.

Do not confuse the concept of UI Automation Name with the Windows Phone property FrameworkElement.Name. The UI Automation Name is often used directly in accessibility scenarios, and is often presented to users of assistive technologies. In fact the UI Automation Name is one of the primary pieces of identifying information that an assistive technology uses when representing an interface. For this reason, it is important to populate your application with UI Automation Name values that are useful for accessibility of your application. In contrast, FrameworkElement.Name is more intended as a programmatic identifier. In this role the FrameworkElement.Name is part of the XAML programming model and related to the XAML+code-behind purpose of the XAMLx:Name attribute. A FrameworkElement.Name is not necessarily intended to be human-readable. In fact, it is common that design tools populate a FrameworkElement.Name value based entirely on deterministic factors such as control type and the number of occurences for that control type in a page scope. FrameworkElement.Name is generally not the best choice for a UI Automation Name. Nevertheless, there are many GetNameCore implementations that use the FrameworkElement.Name as a fallback, only because it is still better to have some unique identifier as opposed to no UI Automation Name at all Always check your application's full set of UI Automation Name values, as part of a test-based methodology for making your application accessible.

Notes to Inheritors

The return value for this method in the FrameworkElementAutomationPeer implementation comes from the AutomationProperties.Name property store on the peer.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft