WPF equivalent property AccesibleName

In WinForms applications, you can name controls for accessibility clients using a property Control.AccessibleName.

WPF controls do not have this property, so I am wondering how I can provide an accessible name for the controls in a WPF application.


I have read the documentation and I know that all of this has changed with help UIA, but I still cannot 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 a name. Where is he hidden?

+5
source share
1 answer

AutomationProperties.Name is the nested property you are looking for.

You can specify it directly in XAML:

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

/ AutomationProperties:

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

... ...

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

All Articles