共用方式為


AutomationProperties Class

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

Provides support for getting or setting the value of 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 Hierarchy

System.Object
  System.Windows.Automation.AutomationProperties

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

Syntax

'Declaration
Public NotInheritable Class AutomationProperties
public static class AutomationProperties

The AutomationProperties type exposes the following members.

Attached Properties

  Name Description
Public attached propertySupported by Silverlight for Windows Phone AcceleratorKey Gets or sets the accelerator key string for the element.
Public attached propertySupported by Silverlight for Windows Phone AccessKey Gets or sets the access key for the element.
Public attached propertySupported by Silverlight for Windows Phone AutomationId Gets or set the string that uniquely identifies the element to UI automation.
Public attached propertySupported by Silverlight for Windows Phone HelpText Gets or sets the help text for the element.
Public attached propertySupported by Silverlight for Windows Phone IsRequiredForForm Gets or sets a value that indicates whether the element is required to be filled out on a form.
Public attached propertySupported by Silverlight for Windows Phone ItemStatus Gets or sets a description of the status of an item in an element.
Public attached propertySupported by Silverlight for Windows Phone ItemType Gets or sets a description of the type of the specified element.
Public attached propertySupported by Silverlight for Windows Phone LabeledBy Gets or sets the element that contains the text label for the element.
Public attached propertySupported by Silverlight for Windows Phone Name Gets or sets the automation name of the element.

Top

Methods

  Name Description
Public methodStatic memberSupported by Silverlight for Windows Phone GetAcceleratorKey Gets the value of the AutomationProperties.AcceleratorKey attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetAccessKey Gets the value of the AutomationProperties.AccessKey attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetAutomationId Gets the value of the AutomationProperties.AutomationId attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetHelpText Gets the value of the AutomationProperties.HelpText attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetIsRequiredForForm Gets the value of the AutomationProperties.IsRequiredForForm attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetItemStatus Gets the value of the AutomationProperties.ItemStatus attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetItemType Gets the value of the AutomationProperties.ItemType attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetLabeledBy Gets the value of the AutomationProperties.LabeledBy attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone GetName Gets the value of the AutomationProperties.Name attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetAcceleratorKey Sets the value of the AutomationProperties.AcceleratorKey attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetAccessKey Sets the value of the AutomationProperties.AccessKey attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetAutomationId Sets the value of the AutomationProperties.AutomationId attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetHelpText Sets the value of the AutomationProperties.HelpText attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetIsRequiredForForm Sets the value of the AutomationProperties.IsRequiredForForm attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetItemStatus Sets the value of the AutomationProperties.ItemStatus attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetItemType Sets the value of the AutomationProperties.ItemType attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetLabeledBy Sets the value of the AutomationProperties.LabeledBy attached property for the specified DependencyObject.
Public methodStatic memberSupported by Silverlight for Windows Phone SetName Sets the value of the AutomationProperties.Name attached property for the specified DependencyObject.

Top

Fields

  Name Description
Public fieldStatic memberSupported by Silverlight for Windows Phone AcceleratorKeyProperty Identifies the AutomationProperties.AcceleratorKey attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone AccessKeyProperty Identifies the AutomationProperties.AccessKey attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone AutomationIdProperty Identifies the AutomationProperties.AutomationId attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone HelpTextProperty Identifies the AutomationProperties.HelpText attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone IsRequiredForFormProperty Identifies the AutomationProperties.IsRequiredForForm attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone ItemStatusProperty Identifies the AutomationProperties.ItemStatus attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone ItemTypeProperty Identifies the AutomationProperties.ItemType attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone LabeledByProperty Identifies the AutomationProperties.LabeledBy attached property.
Public fieldStatic memberSupported by Silverlight for Windows Phone NameProperty Identifies the AutomationProperties.Name attached property.

Top

Remarks

Scenarios and techniques for System.Windows.Automation.AutomationProperties are described in detail in the topic Automation Properties for Accessibility Support in UI.

This class defines several attached properties. In Silverlight, all attached properties are backed by dependency properties. Attached properties are a XAML concept, whereas dependency properties are a concept implemented by Silverlight and also WPF. Thus the attached property system in Silverlight includes concepts that are related to XAML as well as to the general Silverlight dependency property concepts. In code, you can get or set the attached properties either using a dedicated accessor, or by using GetValue and SetValue.

For example, to set a value for AutomationProperties.AutomationId in code, you could either call SetAutomationId (the dedicated accessor), or call SetValue and pass the AutomationIdProperty identifier. For more information on attached properties in Silverlight, see Attached Properties Overview.

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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.