-api-id | -api-type |
---|---|
T:Microsoft.UI.Xaml.Automation.Peers.ComboBoxItemAutomationPeer |
winrt class |
Exposes the ComboBoxItem contents in a ComboBox to Microsoft UI Automation.
The Windows Runtime ComboBoxItem class creates a new ComboBoxItemAutomationPeer as its OnCreateAutomationPeer definition. Derive your automation peer from ComboBoxItemAutomationPeer if you are deriving a custom class from ComboBoxItem 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.
ComboBoxItemAutomationPeer 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 doesn't have any patterns. However, the content of the ComboBoxItem might have a specific peer, for example if it is a TextBox. The parent ComboBox has the support for any selection-related automation behavior.
- GetClassName returns "ComboBoxItem".
- GetAutomationControlType returns AutomationControlType.ListItem.
- Because a ComboBoxItem is a ContentControl, GetName returns a string value based on examining the current Content. This is implemented so that consumers of the control don't always need to provide an AutomationProperties.Name value in app code, and can use a generated-from-content value for the automation Name directly from the UI definition. For more info on how this works, see Basic accessibility information. 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.
FrameworkElementAutomationPeer, ComboBoxItem, ComboBoxAutomationPeer, Custom automation peers