Rediger

Del via


Implementing the UI Automation MultipleView Control Pattern

Note

This documentation is intended for .NET Framework developers who want to use the managed UI Automation classes defined in the System.Windows.Automation namespace. For the latest information about UI Automation, see Windows Automation API: UI Automation.

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

The MultipleViewPattern control pattern is used to support controls that provide, and are able to switch between, multiple representations of the same set of information or child controls.

Examples of controls that can present multiple views include the list view (which can show its contents as thumbnails, tiles, icons, or details), Microsoft Excel charts (pie, line, bar, cell value with a formula), Microsoft Word documents (normal, Web layout, print layout, reading layout, outline), Microsoft Outlook calendar (year, month, week, day), and Microsoft Windows Media Player skins. The supported views are determined by the control developer and are specific to each control.

Implementation Guidelines and Conventions

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

  • IMultipleViewProvider should also be implemented on a container that manages the current view if it is different from a control that provides the current view. For example, Windows Explorer contains a List control for the current folder content while the view for the control is managed from the Windows Explorer application.

  • A control that is able to sort its content is not considered to support multiple views.

  • The collection of views must be identical across instances.

  • View names must be suitable for use in Text to Speech, Braille, and other human-readable applications.

Required Members for IMultipleViewProvider

The following properties and methods are required for implementing IMultipleViewProvider.

Required members Member type Notes
CurrentView Property None
GetSupportedViews Method None
GetViewName Method None
SetCurrentView Method None

There are no events associated with this control pattern.

Exceptions

Provider must throw the following exceptions.

Exception type Condition
ArgumentException When either SetCurrentView or GetViewName is called with a parameter that is not a member of the supported views collection.

See also