FrameworkElementAutomationPeer.GetNameCore Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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)

Syntax

'Declaration
Protected Overrides Function GetNameCore As String
protected override string GetNameCore()

Return Value

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

Remarks

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 Silverlight 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 Silverlight programming model and related to the XAML+code-behind purpose of the XAML x: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. For more information, see Silverlight Accessibility Overview.

Notes to Inheritors

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.