ItemAutomationPeer
ItemAutomationPeer
ItemAutomationPeer
ItemAutomationPeer
Class
Definition
public : class ItemAutomationPeer : AutomationPeer, IItemAutomationPeer, IVirtualizedItemProviderpublic class ItemAutomationPeer : AutomationPeer, IItemAutomationPeer, IVirtualizedItemProviderPublic Class ItemAutomationPeer Inherits AutomationPeer Implements IItemAutomationPeer, IVirtualizedItemProvider// This API is not available in Javascript.
- Inheritance
-
ItemAutomationPeerItemAutomationPeerItemAutomationPeerItemAutomationPeer
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
ItemAutomationPeer is generated from items control logic and ItemsControlAutomationPeer, not an associated control class.
In addition to the typical peer implementation API, ItemAutomationPeer has an ItemsControlAutomationPeer property to reference its container peer. The container peer potentially supplies the logic for AutomationPeer methods as called against the ItemAutomationPeer. There is also an Item property that is similar in purpose to the Owner property on other peers (it provides the reference to the object that this peer provides the automation exposure for). Both these values must be set in the ItemAutomationPeer constructor.
ItemAutomationPeer implements the Realize method in order to support the IVirtualizedItemProvider control pattern. Clients can call their framework's equivalent pattern access to Realize to get a non-virtualized result. This generates more information about the item in an automation tree view.
Default peer implementation and overrides in ItemDatAutomationPeer
ItemAutomationPeer has overrides of Core methods such that the associated AutomationPeer methods provide peer-specific information to a Microsoft UI Automation client.
- GetPattern reports that the peer supports PatternInterface.VirtualizedItem (IVirtualizedItemProvider ). Also, there is "GetContainerPeer" logic that reports information about the item container's supported patterns.
- GetClassName uses "GetContainerPeer" logic to get class name information. If there is no container peer, calling GetClassName throws ElementNotAvailableException.
- GetName uses "GetContainerPeer" logic but if no container peer exists it will use a basic
ToString()logic to try and generate a default automation name from the item content. - GetAutomationControlType uses "GetContainerPeer" logic to get control type information. If there is no container peer, returns AutomationControlType.ListItem.
- "GetContainerPeer" logic is used to forward most of the other AutomationPeer methods from the container peer implementations if possible. For example, IsControlElement might check the container peer first. Some of these AutomationPeer methods will throw ElementNotAvailableException if there is no container peer available. This is one of the only peer classes in the Windows Runtime support for Microsoft UI Automation that does not use FrameworkElementAutomationPeer as a base class.
ItemAutomationPeer derived classes
ItemAutomationPeer is the parent class for SelectorItemAutomationPeer.
Constructors
ItemAutomationPeer(Object, ItemsControlAutomationPeer) ItemAutomationPeer(Object, ItemsControlAutomationPeer) ItemAutomationPeer(Object, ItemsControlAutomationPeer) ItemAutomationPeer(Object, ItemsControlAutomationPeer)
Initializes a new instance of the ItemAutomationPeer class.
public : ItemAutomationPeer(PlatForm::Object item, ItemsControlAutomationPeer parent)public ItemAutomationPeer(Object item, ItemsControlAutomationPeer parent)Public Sub New(item As Object, parent As ItemsControlAutomationPeer)// This API is not available in Javascript.
- item
- PlatForm::Object Object Object Object
The specific item to create for.
- parent
- ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer
The items-control owner to create for.
Properties
Item Item Item Item
Gets the data item in the Items collection that is associated with this ItemAutomationPeer.
public : PlatForm::Object Item { get; }public object Item { get; }Public ReadOnly Property Item As object// This API is not available in Javascript.
- Value
- PlatForm::Object object object object
The data item.
Remarks
This property is similar in purpose to the Owner property on other peers (it provides the reference to the object that this peer provides the automation exposure for). Its value must be set in the ItemAutomationPeer constructor.
ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer
Gets the ItemsControlAutomationPeer that is associated with the ItemsControl that holds the Items collection.
public : ItemsControlAutomationPeer ItemsControlAutomationPeer { get; }public ItemsControlAutomationPeer ItemsControlAutomationPeer { get; }Public ReadOnly Property ItemsControlAutomationPeer As ItemsControlAutomationPeer// This API is not available in Javascript.
- Value
- ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer ItemsControlAutomationPeer
The ItemsControlAutomationPeer associated with the ItemsControl that holds the Items collection.