Edit

Share via


Control patterns and interfaces

Lists the Microsoft UI Automation control patterns, the classes that clients use to access them, and the interfaces providers use to implement them.

The table in this topic describes the Microsoft UI Automation control patterns. The table also lists the classes used by UI Automation clients to access the control patterns and the interfaces used by UI Automation providers to implement them. The Control pattern column shows the pattern name from the UI Automation client perspective, as a constant value listed in Control Pattern Availability Property Identifiers. From the UI Automation provider perspective, each of these patterns is a PatternInterface constant name. The Class provider interface column shows the name of the interface that providers implement to provide this pattern for a custom XAML control.

Note

For WinUI apps built with the Windows App SDK, use the interfaces in Microsoft.UI.Xaml.Automation.Provider. For UWP apps, use Windows.UI.Xaml.Automation.Provider.

For more info about how to implement custom automation peers that expose control patterns and implement the interfaces, see Custom automation peers.

When you implement a control pattern, you should also consult the UI Automation provider documentation that explains some of the expectations that clients will have of a control pattern regardless of which UI framework is used to implement it. Some of the info listed in the general UI Automation provider documentation will influence how you implement your peers and correctly support that pattern. See Implementing UI Automation Control Patterns, and view the page that documents the pattern you intend to implement.

Control pattern WinUI provider interface UWP provider interface Description
Annotation IAnnotationProvider IAnnotationProvider Used to expose the properties of an annotation in a document.
Dock IDockProvider IDockProvider Used for controls that can be docked in a docking container. For example, toolbars or tool palettes.
Drag IDragProvider IDragProvider Used to support draggable controls, or controls with draggable items.
DropTarget IDropTargetProvider IDropTargetProvider Used to support controls that can be the target of a drag-and-drop operation.
ExpandCollapse IExpandCollapseProvider IExpandCollapseProvider Used to support controls that visually expand to display more content and collapse to hide content.
Grid IGridProvider IGridProvider Used for controls that support grid functionality such as sizing and moving to a specified cell. Note that Grid itself does not implement this pattern because it provides layout but is not a control.
GridItem IGridItemProvider IGridItemProvider Used for controls that have cells within grids.
Invoke IInvokeProvider IInvokeProvider Used for controls that can be invoked, such as a Button.
ItemContainer IItemContainerProvider IItemContainerProvider Enables applications to find an element in a container, such as a virtualized list.
MultipleView IMultipleViewProvider IMultipleViewProvider Used for controls that can switch between multiple representations of the same set of information, data, or children.
ObjectModel IObjectModelProvider IObjectModelProvider Used to expose a pointer to the underlying object model of a document.
RangeValue IRangeValueProvider IRangeValueProvider Used for controls that have a range of values that can be applied to the control. For example, a spinner control containing years might have a range of 1900 to the current year, while another spinner control presenting months would have a range of 1 to 12.
Scroll IScrollProvider IScrollProvider Used for controls that can scroll. For example, a control that has scroll bars that are active when there is more information than can be displayed in the viewable area of the control.
ScrollItem IScrollItemProvider IScrollItemProvider Used for controls that have individual items in a list that scrolls. For example, a list control that has individual items in the scroll list, such as a combo box control.
Selection ISelectionProvider ISelectionProvider Used for selection container controls. For example, ListBox and ComboBox.
SelectionItem ISelectionItemProvider ISelectionItemProvider Used for individual items in selection container controls, such as list boxes and combo boxes.
Spreadsheet ISpreadsheetProvider ISpreadsheetProvider Used to expose the contents of a spreadsheet or other grid-based document.
SpreadsheetItem ISpreadsheetItemProvider ISpreadsheetItemProvider Used to expose the properties of a cell in a spreadsheet or other grid-based document.
Styles IStylesProvider IStylesProvider Used to describe a UI element that has a specific style, fill color, fill pattern, or shape.
SynchronizedInput ISynchronizedInputProvider ISynchronizedInputProvider Enables UI Automation client apps to direct the mouse or keyboard input to a specific UI element.
Table ITableProvider ITableProvider Used for controls that have a grid as well as header information. For example, a tabular calendar control.
TableItem ITableItemProvider ITableItemProvider Used for items in a table.
Text ITextProvider ITextProvider Used for edit controls and documents that expose textual information. See also ITextRangeProvider and ITextProvider2.
TextChild ITextChildProvider ITextChildProvider Used to access an element's nearest ancestor that supports the Text control pattern.
TextEdit No managed class available No managed class available Provides access to a control that modifies text, for example a control that performs auto-correction or enables input composition through an Input Method Editor (IME).
TextRange ITextRangeProvider ITextRangeProvider Provides access to a span of continuous text in a text container that implements ITextProvider. See also ITextRangeProvider2.
Toggle IToggleProvider IToggleProvider Used for controls where the state can be toggled. For example, CheckBox and menu items that can be checked.
Transform ITransformProvider ITransformProvider Used for controls that can be resized, moved, and rotated. Typical uses for the Transform control pattern are in designers, forms, graphical editors, and drawing applications.
Value IValueProvider IValueProvider Allows clients to get or set a value on controls that do not support a range of values.
VirtualizedItem IVirtualizedItemProvider IVirtualizedItemProvider Exposes items inside containers that are virtualized and need to be made fully accessible as UI Automation elements.
Window IWindowProvider IWindowProvider Exposes information specific to windows, a fundamental concept to the Microsoft Windows operating system. Examples of controls that are windows are child windows and dialogs.

Note

Not all of these patterns are implemented by existing XAML controls. Some pattern interfaces exist only to maintain parity with the general UI Automation framework's pattern definitions and to support automation peer scenarios that require a fully custom implementation.