AutomationPeer AutomationPeer AutomationPeer Class

Provides a base class that exposes the automation peer for an associated owner class to Microsoft UI Automation.

Syntax

Declaration

public class AutomationPeerpublic class AutomationPeerPublic Class AutomationPeer

Inheritance Hierarchy

Remarks

AutomationPeer is the class that provides almost all of the API that eventually forwards the Microsoft UI Automation information for a Windows Store app using C++, C#, or Visual Basic to a Microsoft UI Automation client. Typical Microsoft UI Automation clients aren't calling AutomationPeer methods directly. These clients are often assistive technology that are using other programming models and operating as services, and are not likely to be calling Windows Runtime methods. But the general Microsoft UI Automation support in the Windows Runtime forwards all this information using the provider side of the Microsoft UI Automation framework. Any clients to Microsoft UI Automation can interact with the representative automation trees of a Windows Store app using C++, C#, or Visual Basic.

Firing automation events

The AutomationPeer class is relevant to Windows Runtime control authors because you will have a peer instance available at run time, after the runtime invokes the OnCreateAutomationPeer method. Using this peer, you can fire automation events by calling RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents) and RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object). You would do this whenever a related property in the peer's owner (your class) changes, or when firing an event is needed for correct automation support.

The automation support design doesn't retain a handle to your own peer as part of how you implement OnCreateAutomationPeer, because there aren't any guarantees of when the peer is actually created. Instead, you can check for run-time automation event listeners inside your control class definitions just-in-time, using code like this:```csharp if (AutomationPeer.ListenerExists(AutomationEvents.PropertyChanged)) { MyAutomationPeer peer = FrameworkElementAutomationPeer.FromElement(myCtrl) as MyAutomationPeer;

if (peer != null)
{
    peer.RaisePropertyChangedEvent(
        RangeValuePatternIdentifiers.ValueProperty,
        (double)oldValue,
        (double)newValue);
}

}


```vbnet
If AutomationPeer.ListenerExists(AutomationEvents.PropertyChanged) Then
    Dim peer As MyAutomationPeer = _
    TryCast(FrameworkElementAutomationPeer.FromElement(myCtrl), MyAutomationPeer)
    If peer IsNot Nothing Then
        peer.RaisePropertyChangedEvent(RangeValuePatternIdentifiers.ValueProperty, CDbl(oldValue), CDbl(newValue))
    End If
End If

AutomationPeer derived classes

AutomationPeer is in the hierarchy for all the existing peers for the Windows Runtime controls and related UI classes.

Classes that directly derive from AutomationPeer are:

Core methods

The "Core" methods are the standard implementations that perform the default action of an associated Microsoft UI Automation client-callable method. You can override any of the "Core" methods to return alternative values in a custom automation peer. For example, GetAcceleratorKeyCore is invoked any time that GetAcceleratorKey() is called, GetAccessKeyCore is invoked any time that GetAccessKey() is called, and so on.

The base implementation for AutomationPeer returns null. Peers that represent items may defer the result to their container.

Properties summary

Gets or sets an AutomationPeer that is reported to the automation client as the source for all the events that come from this AutomationPeer. See Remarks.

Methods summary

Generates a runtime identifier for the element that is associated with the automation peer.

Gets the accelerator key combinations for the object that is associated with the UI Automation peer.

Gets the access key for the element that is associated with the automation peer.

Gets a reference to the list of UI automation annotations for the current automation peer.

Gets the control type for the element that is associated with the UI Automation peer.

Gets the AutomationId of the element that is associated with the automation peer.

Gets the Rect object that represents the screen coordinates of the element that is associated with the automation peer.

Gets the collection of child elements that are represented in the UI Automation tree as immediate child elements of the automation peer.

Gets a name that is used with AutomationControlType, to differentiate the control that is represented by this AutomationPeer.

Gets a point on the element that is associated with the automation peer that responds to a mouse click.

Provides the peer's behavior when a Microsoft UI Automation client calls GetControlledPeers() or an equivalent Microsoft UI Automation client API such as getting a property value as identified by UIA_ControllerForPropertyId.

Gets an element from the specified point.

Gets the element that currently has the focus.

Gets a localized string that describes the actual visual appearance or contents of something such as an image or image control.

Gets text that describes the functionality of the control that is associated with the automation peer.

Gets text that conveys the visual status of the element that is associated with this automation peer.

Gets a string that describes what kind of item an element represents.

Gets the AutomationPeer for the UIElement that is targeted to the element.

Gets the landmark type for this automation peer.

Returns the 1-based integer for the level (hierarchy) of the element that is associated with the automation peer.

Gets the live setting notification behavior information for the object that is associated with the UI Automation peer.

Gets a localized string that represents the AutomationControlType value for the control that is associated with this automation peer.

Gets a localized string that represents the AutomationLandmarkType value for the element that is associated with this automation peer.

Gets text that describes the element that is associated with this automation peer. The Microsoft UI Automation Name value is the primary identifier used by most assistive technology when they represent your app's UI by interacting with the Microsoft UI Automation framework.

Gets a value that indicates the explicit control orientation, if any.

Gets the AutomationPeer that is the parent of this AutomationPeer.

Gets the control pattern that is associated with the specified PatternInterface.

Gets an AutomationPeer from the specified point.

Returns the 1-based integer for the ordinal position in the set for the element that is associated with the automation peer.

Returns the 1-based integer for the size of the set where the element that is associated with the automation peer is located.

Gets a value that indicates whether the element that is associated with this automation peer currently has keyboard focus.

Triggers recalculation of the main properties of the AutomationPeer and raises the RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object) notification to the automation client if the properties have changed.

Gets a value that indicates whether the element that is associated with this automation peer contains data that is presented to the user.

Gets a value that indicates whether the element is understood by the user as interactive or as contributing to the logical structure of the control in the GUI.

Gets a Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the automation element.

Gets a value that indicates whether the element associated with this automation peer supports interaction.

Gets a value that indicates whether the element can accept keyboard focus.

Gets a value that indicates whether an element is off the screen.

Gets a value that indicates whether the element contains sensitive content.

Gets a Boolean value that indicates whether the automation element represents peripheral UI.

Gets a value that indicates whether the element that is associated with this peer must be completed on a form.

Gets a value that indicates whether Microsoft UI Automation reports that a client is listening for the specified event.

Gets the element in the specified direction within the UI automation tree.

Raises an automation event.

Raises an event to notify the automation client of a changed property value.

Raises an event to notify the Microsoft UI Automation core that the tree structure has changed.

Raises an event to notify the Microsoft UI Automation core that a text control has programmatically changed text.

Sets the keyboard focus on the element that is associated with this automation peer.

Sets the AutomationPeer that is the parent of this AutomationPeer.

Shows the available context menu for the owner element.

Properties

  • EventsSource
    EventsSource
    EventsSource
    EventsSource

    Gets or sets an AutomationPeer that is reported to the automation client as the source for all the events that come from this AutomationPeer. See Remarks.

    public AutomationPeer EventsSource { get; set; }public AutomationPeer EventsSource { get; set; }Public ReadWrite Property EventsSource As AutomationPeer

    Property Value

    Remarks

    EventsSource is typically set by AutomationPeer implementations in cases where the automation provider element is a child element of another element that also has a peer, and the best automation experience for clients is to treat the parent as the source for automation events. In such cases, the child element's peer implementation sets EventsSource to return the AutomationPeer of the parent element.

Methods

  • GenerateRawElementProviderRuntimeId()
    GenerateRawElementProviderRuntimeId()
    GenerateRawElementProviderRuntimeId()
    GenerateRawElementProviderRuntimeId()

    Generates a runtime identifier for the element that is associated with the automation peer.

    public static RawElementProviderRuntimeId GenerateRawElementProviderRuntimeId()public static RawElementProviderRuntimeId GenerateRawElementProviderRuntimeId()Public Static Function GenerateRawElementProviderRuntimeId() As RawElementProviderRuntimeId

    Returns

  • GetAcceleratorKey()
    GetAcceleratorKey()
    GetAcceleratorKey()
    GetAcceleratorKey()

    Gets the accelerator key combinations for the object that is associated with the UI Automation peer.

    public string GetAcceleratorKey()public string GetAcceleratorKey()Public Function GetAcceleratorKey() As string

    Returns

    • string
      string
      string

      The accelerator key.

  • GetAccessKey()
    GetAccessKey()
    GetAccessKey()
    GetAccessKey()

    Gets the access key for the element that is associated with the automation peer.

    public string GetAccessKey()public string GetAccessKey()Public Function GetAccessKey() As string

    Returns

    • string
      string
      string

      The access key.

  • GetAnnotations()
    GetAnnotations()
    GetAnnotations()
    GetAnnotations()

    Gets a reference to the list of UI automation annotations for the current automation peer.

    public IVector<AutomationPeerAnnotation> GetAnnotations()public IVector<AutomationPeerAnnotation> GetAnnotations()Public Function GetAnnotations() As IVector( Of AutomationPeerAnnotation )

    Returns

    • The list of UI automation annotations.

  • GetAutomationControlType()
    GetAutomationControlType()
    GetAutomationControlType()
    GetAutomationControlType()

    Gets the control type for the element that is associated with the UI Automation peer.

    public AutomationControlType GetAutomationControlType()public AutomationControlType GetAutomationControlType()Public Function GetAutomationControlType() As AutomationControlType

    Returns

  • GetAutomationId()
    GetAutomationId()
    GetAutomationId()
    GetAutomationId()

    Gets the AutomationId of the element that is associated with the automation peer.

    public string GetAutomationId()public string GetAutomationId()Public Function GetAutomationId() As string

    Returns

    • string
      string
      string

      The automation identifier.

  • GetBoundingRectangle()
    GetBoundingRectangle()
    GetBoundingRectangle()
    GetBoundingRectangle()

    Gets the Rect object that represents the screen coordinates of the element that is associated with the automation peer.

    public Rect GetBoundingRectangle()public Rect GetBoundingRectangle()Public Function GetBoundingRectangle() As Rect

    Returns

  • GetChildren()
    GetChildren()
    GetChildren()
    GetChildren()

    Gets the collection of child elements that are represented in the UI Automation tree as immediate child elements of the automation peer.

    public IVector<AutomationPeer> GetChildren()public IVector<AutomationPeer> GetChildren()Public Function GetChildren() As IVector( Of AutomationPeer )

    Returns

  • GetClassName()
    GetClassName()
    GetClassName()
    GetClassName()

    Gets a name that is used with AutomationControlType, to differentiate the control that is represented by this AutomationPeer.

    public string GetClassName()public string GetClassName()Public Function GetClassName() As string

    Returns

    • string
      string
      string

      The class name.

  • GetClickablePoint()
    GetClickablePoint()
    GetClickablePoint()
    GetClickablePoint()

    Gets a point on the element that is associated with the automation peer that responds to a mouse click.

    public Point GetClickablePoint()public Point GetClickablePoint()Public Function GetClickablePoint() As Point

    Returns

  • GetControlledPeers()
    GetControlledPeers()
    GetControlledPeers()
    GetControlledPeers()

    Provides the peer's behavior when a Microsoft UI Automation client calls GetControlledPeers() or an equivalent Microsoft UI Automation client API such as getting a property value as identified by UIA_ControllerForPropertyId.

    public IVectorView<AutomationPeer> GetControlledPeers()public IVectorView<AutomationPeer> GetControlledPeers()Public Function GetControlledPeers() As IVectorView( Of AutomationPeer )

    Returns

    • A list of the controlled peers for the current automation peer.

    Remarks

    Examining controlled peers is an advanced scenario that most peer implementations won't need to use.

    The naming of the framework implementation and the Microsoft UI Automation property that clients can use to access this info are slightly different. Microsoft UI Automation clients should use the identifier UIA_ControllerForPropertyId to request the value of this property when using the Microsoft UI Automation client interfaces such as IUIAutomation.

  • GetElementFromPoint(Windows.Foundation.Point)
    GetElementFromPoint(Windows.Foundation.Point)
    GetElementFromPoint(Windows.Foundation.Point)
    GetElementFromPoint(Windows.Foundation.Point)

    Gets an element from the specified point.

    public object GetElementFromPoint(Windows.Foundation.Point pointInWindowCoordinates)public object GetElementFromPoint(Windows.Foundation.Point pointInWindowCoordinates)Public Function GetElementFromPoint(pointInWindowCoordinates As Windows.Foundation.Point) As object

    Parameters

    Returns

    • object
      object
      object

      The element at the specified point.

  • GetFocusedElement()
    GetFocusedElement()
    GetFocusedElement()
    GetFocusedElement()

    Gets the element that currently has the focus.

    public object GetFocusedElement()public object GetFocusedElement()Public Function GetFocusedElement() As object

    Returns

    • object
      object
      object

      The element that currently has the focus.

  • GetFullDescription()
    GetFullDescription()
    GetFullDescription()
    GetFullDescription()

    Gets a localized string that describes the actual visual appearance or contents of something such as an image or image control.

    public string GetFullDescription()public string GetFullDescription()Public Function GetFullDescription() As string

    Returns

    • string
      string
      string

      A localized string that describes the actual visual appearance or contents of something such as an image or image control.

  • GetHelpText()
    GetHelpText()
    GetHelpText()
    GetHelpText()

    Gets text that describes the functionality of the control that is associated with the automation peer.

    public string GetHelpText()public string GetHelpText()Public Function GetHelpText() As string

    Returns

    • string
      string
      string

      The help text.

  • GetItemStatus()
    GetItemStatus()
    GetItemStatus()
    GetItemStatus()

    Gets text that conveys the visual status of the element that is associated with this automation peer.

    public string GetItemStatus()public string GetItemStatus()Public Function GetItemStatus() As string

    Returns

    • string
      string
      string

      The item status.

  • GetItemType()
    GetItemType()
    GetItemType()
    GetItemType()

    Gets a string that describes what kind of item an element represents.

    public string GetItemType()public string GetItemType()Public Function GetItemType() As string

    Returns

    • string
      string
      string

      The kind of item.

  • GetLabeledBy()
    GetLabeledBy()
    GetLabeledBy()
    GetLabeledBy()

    Gets the AutomationPeer for the UIElement that is targeted to the element.

    public AutomationPeer GetLabeledBy()public AutomationPeer GetLabeledBy()Public Function GetLabeledBy() As AutomationPeer

    Returns

  • GetLandmarkType()
    GetLandmarkType()
    GetLandmarkType()
    GetLandmarkType()

    Gets the landmark type for this automation peer.

    public AutomationLandmarkType GetLandmarkType()public AutomationLandmarkType GetLandmarkType()Public Function GetLandmarkType() As AutomationLandmarkType

    Returns

  • GetLevel()
    GetLevel()
    GetLevel()
    GetLevel()

    Returns the 1-based integer for the level (hierarchy) of the element that is associated with the automation peer.

    public int GetLevel()public int GetLevel()Public Function GetLevel() As int

    Returns

    • int
      int
      int

      The 1-based integer for the level of the element.

  • GetLiveSetting()
    GetLiveSetting()
    GetLiveSetting()
    GetLiveSetting()

    Gets the live setting notification behavior information for the object that is associated with the UI Automation peer.

    public AutomationLiveSetting GetLiveSetting()public AutomationLiveSetting GetLiveSetting()Public Function GetLiveSetting() As AutomationLiveSetting

    Returns

  • GetLocalizedControlType()
    GetLocalizedControlType()
    GetLocalizedControlType()
    GetLocalizedControlType()

    Gets a localized string that represents the AutomationControlType value for the control that is associated with this automation peer.

    public string GetLocalizedControlType()public string GetLocalizedControlType()Public Function GetLocalizedControlType() As string

    Returns

    • string
      string
      string

      The type of the control.

  • GetLocalizedLandmarkType()
    GetLocalizedLandmarkType()
    GetLocalizedLandmarkType()
    GetLocalizedLandmarkType()

    Gets a localized string that represents the AutomationLandmarkType value for the element that is associated with this automation peer.

    public string GetLocalizedLandmarkType()public string GetLocalizedLandmarkType()Public Function GetLocalizedLandmarkType() As string

    Returns

    • string
      string
      string

      The landmark type of the element.

  • GetName()
    GetName()
    GetName()
    GetName()

    Gets text that describes the element that is associated with this automation peer. The Microsoft UI Automation Name value is the primary identifier used by most assistive technology when they represent your app's UI by interacting with the Microsoft UI Automation framework.

    public string GetName()public string GetName()Public Function GetName() As string

    Returns

    • string
      string
      string

      The name of the element that is the peer's owner, as used by assistive technology and other Microsoft UI Automation clients.

    Remarks

    FrameworkElementAutomationPeer introduces behavior to GetName() by providing an intermediate GetNameCore implementation. If an element has a value for the LabeledByMicrosoft UI Automation property, the labeling element's Name value is used as the Name.

    FrameworkElementAutomationPeer also introduces behavior through an internal GetPlainText method that other default peer classes may override in order to access the content model of that control and return a useful default for Name. For example, any ContentControl derived class will use a string representation of its Content value as the default Name. This is enabled because internally ContentControl implements GetPlainText and imparts that behavior to all ContentControl derived classes. This is how you get a useful Name default from the string value of a Button, for example.

    Other specific peers also may have an intermediate GetNameCore implementation that provides a useful way for that particular Windows Runtime control to provide built-in values for Name. The source of these values comes from other UI properties that are typically set in XAML or as app user code. For example, TextBoxAutomationPeer implements behavior that uses the value of the Text property from the owner TextBox as the default Name. From the user code perspective, the default behavior can be overridden by applying a different NameProperty value. From the peer implementer / provider perspective, the default behavior of the peer can be changed by deriving a new peer class from the existing peer, overriding GetNameCore, and giving it a new implementation that wouldn't call the base implementation in at least some cases.

    To learn more about the possible default behavior of specific peer classes for default Windows Runtime controls, see the reference topic for that particular peer class and look for implementation notes in the Remarks section.

  • GetOrientation()
    GetOrientation()
    GetOrientation()
    GetOrientation()

    Gets a value that indicates the explicit control orientation, if any.

    public AutomationOrientation GetOrientation()public AutomationOrientation GetOrientation()Public Function GetOrientation() As AutomationOrientation

    Returns

  • GetParent()
    GetParent()
    GetParent()
    GetParent()

    Gets the AutomationPeer that is the parent of this AutomationPeer.

    public AutomationPeer GetParent()public AutomationPeer GetParent()Public Function GetParent() As AutomationPeer

    Returns

  • GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface)
    GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface)
    GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface)
    GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface)

    Gets the control pattern that is associated with the specified PatternInterface.

    public object GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface patternInterface)public object GetPattern(Windows.UI.Xaml.Automation.Peers.PatternInterface patternInterface)Public Function GetPattern(patternInterface As Windows.UI.Xaml.Automation.Peers.PatternInterface) As object

    Parameters

    Returns

    • object
      object
      object

      The object that implements the pattern interface; null if the peer does not support this interface.

  • GetPeerFromPoint(Windows.Foundation.Point)
    GetPeerFromPoint(Windows.Foundation.Point)
    GetPeerFromPoint(Windows.Foundation.Point)
    GetPeerFromPoint(Windows.Foundation.Point)

    Gets an AutomationPeer from the specified point.

    public AutomationPeer GetPeerFromPoint(Windows.Foundation.Point point)public AutomationPeer GetPeerFromPoint(Windows.Foundation.Point point)Public Function GetPeerFromPoint(point As Windows.Foundation.Point) As AutomationPeer

    Parameters

    • point

      The relative position of the target UI element in the UI.

    Returns

    Remarks

    This method is a utility for hit testing practical UI coordinates, evaluating the corresponding UI element, and returning the peer that corresponds to the hit-tested UI element.

  • GetPositionInSet()
    GetPositionInSet()
    GetPositionInSet()
    GetPositionInSet()

    Returns the 1-based integer for the ordinal position in the set for the element that is associated with the automation peer.

    public int GetPositionInSet()public int GetPositionInSet()Public Function GetPositionInSet() As int

    Returns

    • int
      int
      int

      The 1-based integer for the ordinal position in the set.

  • GetSizeOfSet()
    GetSizeOfSet()
    GetSizeOfSet()
    GetSizeOfSet()

    Returns the 1-based integer for the size of the set where the element that is associated with the automation peer is located.

    public int GetSizeOfSet()public int GetSizeOfSet()Public Function GetSizeOfSet() As int

    Returns

    • int
      int
      int

      The 1-based integer for the size of the set.

  • HasKeyboardFocus()
    HasKeyboardFocus()
    HasKeyboardFocus()
    HasKeyboardFocus()

    Gets a value that indicates whether the element that is associated with this automation peer currently has keyboard focus.

    public bool HasKeyboardFocus()public bool HasKeyboardFocus()Public Function HasKeyboardFocus() As bool

    Returns

    • bool
      bool
      bool

      true if the element has keyboard focus; otherwise, false.

  • InvalidatePeer()
    InvalidatePeer()
    InvalidatePeer()
    InvalidatePeer()

    Triggers recalculation of the main properties of the AutomationPeer and raises the RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object) notification to the automation client if the properties have changed.

    public void InvalidatePeer()public void InvalidatePeer()Public Function InvalidatePeer() As void
  • IsContentElement()
    IsContentElement()
    IsContentElement()
    IsContentElement()

    Gets a value that indicates whether the element that is associated with this automation peer contains data that is presented to the user.

    public bool IsContentElement()public bool IsContentElement()Public Function IsContentElement() As bool

    Returns

    • bool
      bool
      bool

      true if the element is a content element; otherwise, false.

  • IsControlElement()
    IsControlElement()
    IsControlElement()
    IsControlElement()

    Gets a value that indicates whether the element is understood by the user as interactive or as contributing to the logical structure of the control in the GUI.

    public bool IsControlElement()public bool IsControlElement()Public Function IsControlElement() As bool

    Returns

    • bool
      bool
      bool

      true if the element is a control; otherwise, false.

  • IsDataValidForForm()
    IsDataValidForForm()
    IsDataValidForForm()
    IsDataValidForForm()

    Gets a Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the automation element.

    public bool IsDataValidForForm()public bool IsDataValidForForm()Public Function IsDataValidForForm() As bool

    Returns

    • bool
      bool
      bool

      A Boolean value that indicates whether the entered or selected value is valid for the form rule associated with the automation element. The default return value is true.

    Remarks

    As an example, if the user entered "425-555-5555" for a zip code field that requires 5 or 9 digits, the IsDataValidForForm() property can be set to false to indicate that the data is not valid.

  • IsEnabled()
    IsEnabled()
    IsEnabled()
    IsEnabled()

    Gets a value that indicates whether the element associated with this automation peer supports interaction.

    public bool IsEnabled()public bool IsEnabled()Public Function IsEnabled() As bool

    Returns

    • bool
      bool
      bool

      true if the element supports interaction; otherwise, false.

  • IsKeyboardFocusable()
    IsKeyboardFocusable()
    IsKeyboardFocusable()
    IsKeyboardFocusable()

    Gets a value that indicates whether the element can accept keyboard focus.

    public bool IsKeyboardFocusable()public bool IsKeyboardFocusable()Public Function IsKeyboardFocusable() As bool

    Returns

    • bool
      bool
      bool

      true if the element can accept keyboard focus; otherwise, false.

  • IsOffscreen()
    IsOffscreen()
    IsOffscreen()
    IsOffscreen()

    Gets a value that indicates whether an element is off the screen.

    public bool IsOffscreen()public bool IsOffscreen()Public Function IsOffscreen() As bool

    Returns

    • bool
      bool
      bool

      true if the element is not on the screen; otherwise, false.

  • IsPassword()
    IsPassword()
    IsPassword()
    IsPassword()

    Gets a value that indicates whether the element contains sensitive content.

    public bool IsPassword()public bool IsPassword()Public Function IsPassword() As bool

    Returns

    • bool
      bool
      bool

      true if the element contains sensitive content such as a password; otherwise, false.

    Remarks

    This property enables applications such as screen readers to determine whether the text content of a control should be read aloud.

  • IsPeripheral()
    IsPeripheral()
    IsPeripheral()
    IsPeripheral()

    Gets a Boolean value that indicates whether the automation element represents peripheral UI.

    public bool IsPeripheral()public bool IsPeripheral()Public Function IsPeripheral() As bool

    Returns

    • bool
      bool
      bool

      A Boolean value that indicates whether the automation element represents peripheral UI.

    Remarks

    Peripheral UI appears and supports user interaction, but does not take keyboard focus when it appears. Examples of peripheral UI include popups, flyouts, context menus, or floating notifications.

  • IsRequiredForForm()
    IsRequiredForForm()
    IsRequiredForForm()
    IsRequiredForForm()

    Gets a value that indicates whether the element that is associated with this peer must be completed on a form.

    public bool IsRequiredForForm()public bool IsRequiredForForm()Public Function IsRequiredForForm() As bool

    Returns

    • bool
      bool
      bool

      true if the element must be completed; otherwise, false.

  • ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents)

    Gets a value that indicates whether Microsoft UI Automation reports that a client is listening for the specified event.

    public static bool ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents eventId)public static bool ListenerExists(Windows.UI.Xaml.Automation.Peers.AutomationEvents eventId)Public Static Function ListenerExists(eventId As Windows.UI.Xaml.Automation.Peers.AutomationEvents) As bool

    Parameters

    Returns

    • bool
      bool
      bool

      true if Microsoft UI Automation reports a client is listening for the specified event; otherwise, false.

  • Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection)
    Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection)
    Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection)
    Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection)

    Gets the element in the specified direction within the UI automation tree.

    public object Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection direction)public object Navigate(Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection direction)Public Function Navigate(direction As Windows.UI.Xaml.Automation.Peers.AutomationNavigationDirection) As object

    Parameters

    Returns

    • object
      object
      object

      The element in the specified direction within the UI automation tree.

  • RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents)
    RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents)

    Raises an automation event.

    public void RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents eventId)public void RaiseAutomationEvent(Windows.UI.Xaml.Automation.Peers.AutomationEvents eventId)Public Function RaiseAutomationEvent(eventId As Windows.UI.Xaml.Automation.Peers.AutomationEvents) As void

    Parameters

  • RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object)
    RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object)
    RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object)
    RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty,System.Object,System.Object)

    Raises an event to notify the automation client of a changed property value.

    public void RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty automationProperty,System.Object oldValue,System.Object newValue)public void RaisePropertyChangedEvent(Windows.UI.Xaml.Automation.AutomationProperty automationProperty,System.Object oldValue,System.Object newValue)Public Function RaisePropertyChangedEvent(automationProperty As Windows.UI.Xaml.Automation.AutomationProperty,oldValue As System.Object,newValue As System.Object) As void

    Parameters

    • automationProperty

      The property that changed.

    • oldValue
      System.Object
      System.Object
      System.Object

      The previous value of the property.

    • newValue
      System.Object
      System.Object
      System.Object

      The new value of the property.

  • RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer)

    Raises an event to notify the Microsoft UI Automation core that the tree structure has changed.

    public void RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType structureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer child)public void RaiseStructureChangedEvent(Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType structureChangeType,Windows.UI.Xaml.Automation.Peers.AutomationPeer child)Public Function RaiseStructureChangedEvent(structureChangeType As Windows.UI.Xaml.Automation.Peers.AutomationStructureChangeType,child As Windows.UI.Xaml.Automation.Peers.AutomationPeer) As void

    Parameters

  • RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String})
    RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String})
    RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String})
    RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String})

    Raises an event to notify the Microsoft UI Automation core that a text control has programmatically changed text.

    public void RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType automationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String} changedData)public void RaiseTextEditTextChangedEvent(Windows.UI.Xaml.Automation.AutomationTextEditChangeType automationTextEditChangeType,Windows.Foundation.Collections.IVectorView{System.String} changedData)Public Function RaiseTextEditTextChangedEvent(automationTextEditChangeType As Windows.UI.Xaml.Automation.AutomationTextEditChangeType,changedData As Windows.Foundation.Collections.IVectorView{System.String}) As void

    Parameters

  • SetFocus()
    SetFocus()
    SetFocus()
    SetFocus()

    Sets the keyboard focus on the element that is associated with this automation peer.

    public void SetFocus()public void SetFocus()Public Function SetFocus() As void
  • SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer)
    SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer)

    Sets the AutomationPeer that is the parent of this AutomationPeer.

    public void SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer peer)public void SetParent(Windows.UI.Xaml.Automation.Peers.AutomationPeer peer)Public Function SetParent(peer As Windows.UI.Xaml.Automation.Peers.AutomationPeer) As void

    Parameters

    Remarks

    You can't re-parent an AutomationPeer for a Windows Store app. This functionality is only available for a Windows Phone Store app.

  • ShowContextMenu()
    ShowContextMenu()
    ShowContextMenu()
    ShowContextMenu()

    Shows the available context menu for the owner element.

    public void ShowContextMenu()public void ShowContextMenu()Public Function ShowContextMenu() As void

    Remarks

    Calling ShowContextMenu() throws an error if a context menu cannot be shown. If no context menu is available directly on the element on which it was invoked, the Microsoft UI Automation logic implemented by a provider should attempt to show a context menu for the Microsoft UI Automation tree parent of the element.

    Scenarios for invoking a context menu from an element include auto-correction and spelling alternatives for text input. The UI elements that display these are not part of the default tab sequence and are not part of an initial Microsoft UI Automation tree until the context that requires them is detected.

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Automation.Peers.dll