Implementing the UI Automation SelectionItem Control Pattern

This topic introduces guidelines and conventions for implementing ISelectionItemProvider, including information about properties, methods, and events. Links to additional references are listed at the end of the topic.

The SelectionItem control pattern is used to support controls that act as individual, selectable child items of container controls that implement ISelectionProvider. For examples of controls that implement this control pattern, see Control Pattern Mapping for UI Automation Clients.

This topic contains the following sections.

  • Implementation Guidelines and Conventions
  • Required Members for ISelectionItemProvider
  • Related Topics

Implementation Guidelines and Conventions

When implementing the SelectionItem control pattern, note the following guidelines and conventions:

  • Single-selection controls that manage child controls that implement IRawElementProviderFragmentRoot, such as the Screen Resolution slider in the Display Properties dialog box, should implement ISelectionProvider; their children should implement both IRawElementProviderFragment and ISelectionItemProvider.

Required Members for ISelectionItemProvider

The following properties, methods, and events are required for implementing the ISelectionItemProvider interface.

Required members Member type Notes
ISelectionItemProvider::AddToSelection Method None
ISelectionItemProvider::IsSelected Property None
ISelectionItemProvider::RemoveFromSelection Method None
ISelectionItemProvider::Select Method None
ISelectionItemProvider::SelectionContainer Property None
UIA_SelectionItem_ElementAddedToSelectionEventId Event None
UIA_SelectionItem_ElementRemovedFromSelectionEventId Event None
UIA_SelectionItem_ElementSelectedEventId Event None

If the result of a IUIAutomationSelectionItemPattern::Select, an IUIAutomationSelectionItemPattern::AddToSelection, or a IUIAutomationSelectionItemPattern::RemoveFromSelection is a single selected item, an UIA_SelectionItem_ElementSelectedEventId should be raised; otherwise send UIA_SelectionItem_ElementAddedToSelectionEventId or UIA_SelectionItem_ElementRemovedFromSelectionEventId as appropriate.