AutomationProperties class
TOC
Collapse the table of content
Expand the table of content

AutomationProperties class

Provides support for getting or setting instance-level values of automation properties. These property values are set as attached properties (typically in XAML) and supplement or override automation property values from a control's AutomationPeer.

Inheritance

Object
  AutomationProperties

Syntax


public ref class AutomationProperties sealed 

Members

The AutomationProperties class has these types of members:

Methods

The AutomationProperties class has these methods. It also inherits methods from the Object class.

MethodDescription
GetAcceleratorKey Gets the value of the AutomationProperties.AcceleratorKey attached property for the specified DependencyObject.
GetAccessibilityView Gets the value of the AutomationProperties.AccessibilityView attached property for the specified DependencyObject.
GetAccessKey Gets the value of the AutomationProperties.AccessKey attached property for the specified DependencyObject.
GetAnnotations Gets the value of the AutomationProperties.Annotations property for the specified DependencyObject.
GetAutomationId Gets the value of the AutomationProperties.AutomationId attached property for the specified DependencyObject.
GetControlledPeers A static utility method that retrieves the list of controlled peers from a target owner.
GetDescribedBy Gets a collection of elements that provide more information about the specified automation element.
GetFlowsFrom Gets a list of automation elements that suggests the reading order before the specified automation element.
GetFlowsTo Gets a list of automation elements that suggests the reading order after the specified automation element.
GetFullDescription Gets a localized string that describes the visual appearance or contents of the specified DependencyObject.
GetHelpText Gets the value of the AutomationProperties.HelpText attached property for the specified DependencyObject.
GetIsDataValidForForm Gets a Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the specified element.
GetIsPeripheral Gets a Boolean value that indicates whether the specified element represents peripheral UI.
GetIsRequiredForForm Gets the value of the AutomationProperties.IsRequiredForForm attached property for the specified DependencyObject.
GetItemStatus Gets the value of the AutomationProperties.ItemStatus attached property for the specified DependencyObject.
GetItemType Gets the value of the AutomationProperties.ItemType attached property for the specified DependencyObject.
GetLabeledBy Gets the value of the AutomationProperties.LabeledBy attached property for the specified DependencyObject.
GetLandmarkType Gets the value of the landmark type attached property for the specified DependencyObject.
GetLevel Gets the value of the AutomationProperties.Level property for the specified DependencyObject.
GetLiveSetting Gets the value of the AutomationProperties.LiveSetting attached property for the specified DependencyObject.
GetLocalizedControlType Gets a localized string that indicates the type of the specified control.
GetLocalizedLandmarkType Gets the value of the localized landmark type attached property for the specified DependencyObject.
GetName Gets the value of the AutomationProperties.Name attached property for the specified DependencyObject.
GetPositionInSet Gets the value of the AutomationProperties.PositionInSet property for the specified DependencyObject.
GetSizeOfSet Gets the value of the AutomationProperties.SizeOfSet property for the specified DependencyObject.
SetAcceleratorKey Sets the value of the AutomationProperties.AcceleratorKey attached property for the specified DependencyObject.
SetAccessibilityView Sets the value of the AutomationProperties.AccessibilityView attached property for the specified DependencyObject.
SetAccessKey Sets the value of the AutomationProperties.AccessKey attached property for the specified DependencyObject.
SetAutomationId Sets the value of the AutomationProperties.AutomationId attached property for the specified DependencyObject.
SetFullDescription Sets a localized string that describes the visual appearance or contents of the specified DependencyObject.
SetHelpText Sets the value of the AutomationProperties.HelpText attached property for the specified DependencyObject.
SetIsDataValidForForm Sets a Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the specified element.
SetIsPeripheral Sets a Boolean value that indicates whether the specified element represents peripheral UI.
SetIsRequiredForForm Sets the value of the AutomationProperties.IsRequiredForForm attached property for the specified DependencyObject.
SetItemStatus Sets the value of the AutomationProperties.ItemStatus attached property for the specified DependencyObject.
SetItemType Sets the value of the AutomationProperties.ItemType attached property for the specified DependencyObject.
SetLabeledBy Sets the value of the AutomationProperties.LabeledBy attached property for the specified DependencyObject.
SetLandmarkType Sets the value of the landmark type attached property for the specified DependencyObject.
SetLevel Sets the value of the AutomationProperties.Level property for the specified DependencyObject.
SetLiveSetting Sets the value of the AutomationProperties.LiveSetting attached property for the specified DependencyObject.
SetLocalizedControlType Sets a localized string that indicates the type of the specified control.
SetLocalizedLandmarkType Sets the value of the localized landmark type attached property for the specified DependencyObject.
SetName Sets the value of the AutomationProperties.Name attached property for the specified DependencyObject.
SetPositionInSet Sets the value of the AutomationProperties.PositionInSet property for the specified DependencyObject.
SetSizeOfSet Sets the value of the AutomationProperties.SizeOfSet property for the specified DependencyObject.

 

Attached Properties

The AutomationProperties class has these attached properties.

 

Properties

The AutomationProperties class has these properties.

PropertyAccess typeDescription

AcceleratorKeyProperty

Read-only

Identifies the AutomationProperties.AcceleratorKey attached property, which is a string containing the accelerator key (also called shortcut key) combinations for the automation element.

AccessibilityViewProperty

Read-only

Identifies the AutomationProperties.AccessibilityView attached property. Set this attached property on individual elements in order to change their element visibility to specific modes requested by a UI Automation client.

AccessKeyProperty

Read-only

Identifies the AutomationProperties.AccessKey attached property, which is a string containing the access key character for the automation element.

AnnotationsProperty

Read-only

Identifies a dependency property that's used for a list of annotation objects in a document, such as comment, header, footer, and so on.

AutomationIdProperty

Read-only

Identifies the AutomationProperties.AutomationId attached property, which is a string containing the UI Automation identifier (ID) for the automation element.

ControlledPeersProperty

Read-only

Identifies a dependency property that's used for controlled peers, which is an array of automation elements that are manipulated by the automation element that supports this property.

DescribedByProperty

Read-only

Gets the identifier for the described by attached property, which is an array of elements that provide more information about the automation element.

FlowsFromProperty

Read-only

Gets the identifier for the FlowsFrom attached property, which is an array of automation elements that suggests the reading order before the current automation element.

FlowsToProperty

Read-only

Gets the identifier for the FlowsTo attached property, which is an array of automation elements that suggests the reading order after the current automation element.

FullDescriptionProperty

Read-only

Gets the identifier for the full description attached property, which exposes a localized string containing extended description text for an element.

HelpTextProperty

Read-only

Identifies the AutomationProperties.HelpText attached property, which is a help text string associated with the automation element.

IsDataValidForFormProperty

Read-only

Identifies the Boolean dependency property that indicates if the data is valid for the form.

IsPeripheralProperty

Read-only

Identifies the Boolean dependency property that indicates if the automation element represents peripheral UI.

IsRequiredForFormProperty

Read-only

Identifies the AutomationProperties.IsRequiredForForm attached property, which is a Boolean value that indicates whether the automation element is required to be filled out on a form.

ItemStatusProperty

Read-only

Identifies the AutomationProperties.ItemStatus attached property, which is a text string describing the status of an item of the automation element.

ItemTypeProperty

Read-only

Identifies the AutomationProperties.ItemType attached property, which is a text string describing the type of the automation element.

LabeledByProperty

Read-only

Identifies the AutomationProperties.LabeledBy attached property, which is an automation element that contains the text label for this element.

LandmarkTypeProperty

Read-only

Gets the identifier for the landmark type attached property, which is a Landmark Type Identifier associated with an element.

LevelProperty

Read-only

Gets the identifier for the Level attached property, which is a 1-based integer associated with an automation element.

LiveSettingProperty

Read-only

Identifies the AutomationProperties.LiveSetting attached property, which is supported by an automation element that represents a live region.

LocalizedControlTypeProperty

Read-only

Identifies the localized control type dependency property, which is a text string describing the type of control that the automation element represents.

LocalizedLandmarkTypeProperty

Read-only

Gets the identifier for the localized landmark type attached property, which is a localized text string describing the type of landmark that the automation element represents.

NameProperty

Read-only

Identifies the AutomationProperties.Name attached property, which is a string that holds the name of the automation element.

PositionInSetProperty

Read-only

Gets the identifier for the PositionInSet attached property, which is a 1-based integer associated with an automation element.

SizeOfSetProperty

Read-only

Gets the identifier for the AutomationProperties.SizeOfSet attached property.

 

Remarks

AutomationProperties XAML attached properties

AutomationProperties is the host service class for several XAML attached properties. The purpose of these attached properties is to enable setting various per-instance values that are pertinent to how a UI element is reported to the UI Automation accessibility framework. This is useful in cases where the class design of the UI element doesn't already forward other UI-related property values as part of its UI Automation integration or peer implementation behavior, or where the value being forwarded is not the value you want to report to UI Automation.

These are the XAML attached properties that are supported by AutomationProperties:

In order to support XAML processor access to the attached properties, and also to expose equivalent get and set operations to code, each XAML attached property has a pair of Get and Set accessor methods, which are also members of AutomationProperties. For example, the GetName and SetName methods support and provide the equivalent code-only support for reporting automation Name values to UI Automation, instead of using AutomationProperties.Name to set it in XAML. Alternatively, you can use the dependency property system to get or set the value of the attached property, and this also reports the underlying value to UI Automation. Call GetValue or SetValue, passing the arguments of the dependency property identifier to set, and a reference to the target object on which to get or set the value.

AutomationProperties.Name

Of the various attached properties, probably the most important one is AutomationProperties.Name. This is because it is the Name property that is most frequently accessed and reported by assistive technologies when users interact with an app in an accessibility scenario. The Name serves as the human-readable identifier for the UI element.

Various UI elements have peer forwarding that can provide a default Name value based on other element properties. For example, the peer forwarding for the Button class will forward the ToString evaluation of the Button content and use this string as the default Name. In order to override that default, or to otherwise provide a Name value for any UI element case where there is no UI Automation Name available, set the AutomationProperties.Name attached property on that element in XAML. For more info on why a UI Automation Name is important, see Basic accessibility information. For more info on how to test whether an element already has a peer-supplied Name that is useful, see Accessibility testing.

For localization reasons, you should avoid hard-coded string values for the AutomationProperties.Name in XAML. If you set x:Uid directive on the element, then you can use RESW resources to target the property and provide different values for localization. For attached properties, the resource identifier form requires full qualification of the attached property in XAML form, including its namespace and a using: prefix. For example, to target the AutomationProperties.Name attached property value on a resource that has x:Uid directive value of "sendButton", the name value of the data item in the RESW resources is sendButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Automation
Windows::UI::Xaml::Automation [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Automation
Windows::UI::Xaml::Automation [C++]

Metadata

Windows.winmd

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

See also

Object
Accessibility
Basic accessibility information
Accessibility testing
Attached properties overview
XAML accessibility sample

 

 

Show:
© 2016 Microsoft