-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Automation.Peers.ItemsControlAutomationPeer |
winrt class |
Exposes ItemsControl types to Microsoft UI Automation.
The Windows Runtime ItemsControl class creates a new ItemsControlAutomationPeer as its OnCreateAutomationPeer definition. Derive your automation peer from ItemsControlAutomationPeer if you are deriving a custom class from ItemsControl and want to add automation support for additional features that you enabled in your custom class. Then override OnCreateAutomationPeer so that it returns your custom peer. Make sure though that there aren't any existing derived classes from ItemsControl that might better suit your scenario. For example, Selector, FlipView, GridView, ComboBox, ListViewBase and ListBox are all a type of ItemsControl. Each of these already has a dedicated automation peer.
ItemsControlAutomationPeer 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 provides pattern support for PatternInterface.ItemContainer (IItemContainerProvider). Also, there's logic that looks for scrolling behavior in the owner. If there's scrolling available and a peer can be forwarded to provide the control pattern, the peer can support PatternInterface.Scroll (IScrollProvider).
- There is no GetClassName and GetAutomationControlType is Custom. These values are expected to come from derived peers.
- GetChildren has an extensive implementation that returns the item peers and is used by all the derived peers. The peer also has other behaviors that are provided by the base FrameworkElementAutomationPeer class. For more info, see "Base implementation in FrameworkElementAutomationPeer" section of Custom automation peers.
For Windows Phone 8.x apps, ItemsControlAutomationPeer has methods that support creating item-specific automation peers for data items. See CreateItemAutomationPeer and OnCreateItemAutomationPeer.
ItemsControlAutomationPeer is the parent class for SelectorAutomationPeer.
ItemsControl, FrameworkElementAutomationPeer, IItemContainerProvider, Custom automation peers