WPF equivalent of the AccesibleName property

accessibility, c#, wpf

Solution

`AutomationProperties.Name` is the attached property you are looking for.

You can either specify it directly in XAML:

<object AutomationProperties.Name="name" .../>

Or using the getter/setters on AutomationProperties:

using System.Windows.Automation;
...
AutomationProperties.SetName(control, "name");

...or...

control.SetValue(AutomationProperties.NameProperty, "name");

Problem

In WinForms applications it's possible to name controls for accessibility clients using the `Control.AccessibleName` property. WPF controls are lacking this property, so I'm wondering how I can give an accessible name to controls in an WPF application. I've read the documentations and I know it all changed with the `UIA` but I still can't find a way to change this property. As stated in the doc, there are two required properties : - Name - Automation ID I can find `Automation ID` but not the name. Where is it hidden ?

Original source