Compartilhar via


UI Automation Support for the DataItem Control Type

Observação

Esta documentação destina.Os desenvolvedores do NET Framework que desejam usar o gerenciado UI Automation classes definidas na System.Windows.Automation namespace.As informações mais recentes sobre UI Automation, consulte API de automação do Windows: Automação da interface do usuário.

Este tópico fornece informações sobre Microsoft UI Automation suporte para o DataItem o tipo de controle. Em UI Automation um tipo de controle é um conjunto de condições que um controle deve atender para usar o ControlTypeProperty propriedade. The conditions include specific guidelines for UI Automation tree structure, UI Automation property values and control patterns.

An entry in a Contacts list is an example of a data item control. A data item control contains information that is of interest to an end user. It is more complicated than the simple list item because it contains richer information.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the DataItem control type. O UI Automation requisitos se aplicam a todos os dados a controles de item, se Windows Presentation Foundation (WPF), Win32, ou Windows Forms.

Este tópico contém as seguintes seções.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Working with Data Items in Large Lists
  • Required UI Automation Events
  • DataItem Control Type Example
  • Tópicos relacionados

Required UI Automation Tree Structure

The following table depicts the control view and the content view of the UI Automation tree that pertains to data item controls and describes what can be contained in each view. For more information about the UI Automation tree, see Visão geral da árvore de automação de interface do usuário.

UI Automation Tree - Control View

UI Automation Tree - Content View

DataItem

  • Varia (0 ou mais; podem ser estruturados na hierarquia)

DataItem

  • Varia (0 ou mais; podem ser estruturados na hierarquia)

Um elemento de item de dados em uma grade de dados pode hospedar uma variedade de objetos, incluindo outra camada de itens de dados ou elementos de grade específicos como, por exemplo, texto, imagens ou controles de edição. Se o elemento de item de dados tem uma função de objeto específico, o elemento deve ser exposto como um tipo específico de controle; Por exemplo, um ListItem tipo de controle para um item de dados selecionável na grade.

Required UI Automation Properties

The following table lists the properties whose value or definition is especially relevant to data item controls. For more information about UI Automation properties, see UI Automation Properties for Clients.

Property

Value

Notes

AutomationIdProperty

See notes.

The value of this property needs to be unique across all controls in an application.

BoundingRectangleProperty

See notes.

The outermost rectangle that contains the whole control.

ClickablePointProperty

See notes.

Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and you perform specialized hit testing, then override and provide a clickable point.

ControlTypeProperty

DataItem

This value is the same for all UI frameworks.

IsContentElementProperty

True

The data item control must always be content.

IsControlElementProperty

True

The data item control must always be a control.

IsKeyboardFocusableProperty

See notes.

If the control can receive keyboard focus, it must support this property.

ItemStatusProperty

See notes.

If the control contains status that is being updated dynamically then this property must be supported so that an assistive technology can receive updates when the status of the element changes.

ItemTypeProperty

See notes.

This is the string value that conveys to the end user the underlying object that the item represents. Examples are "Media File" or "Contact".

LabeledByProperty

Null

Data item controls do not have a static text label.

LocalizedControlTypeProperty

"data item"

Localized string corresponding to the DataItem control type.

NameProperty

See notes.

The data item control always contains a primary text element that relates to what the user would associate as the most semantic identifier for the item.

Required UI Automation Control Patterns

The following table lists the Microsoft UI Automation control patterns required to be supported by all data item controls. For more information about control patterns, see Visão Geral de Padrões de Controle de Automação de Interface de Usuário.

Padrão de controle

Support

Notes

IExpandCollapseProvider

Depends

If the data item can be expanded or collapsed to show and hide information, the Expand Collapse pattern must be supported.

IGridItemProvider

Depends

Data items will support the Grid Item pattern when a collection of data items is available within a container that can be spatially navigated item-to-item.

IScrollItemProvider

Depends

All data items support the ability to be scrolled into view with the Scroll Item pattern when their data container has more items than can fit on the screen.

ISelectionItemProvider

Yes

All data items must support the Selection Item pattern to indicate when the item is selected.

ITableItemProvider

Depends

If the data item is contained within a Data Grid control type then it will support this pattern.

IToggleProvider

Depends

If the data item contains a state that can be cycled through.

IValueProvider

Depends

If the data item's primary text is editable then the Value pattern must be supported.

Working with Data Items in Large Lists

Large lists are often data virtualized within UI frameworks to assist in performance. Devido a isso, um o cliente de automação da interface do usuário não é possível usar o UI Automation recurso de consulta para arranhar o conteúdo da árvore inteira da mesma forma que ele possa em outros recipientes de item. Um cliente deve rolar o item no modo de exibição (ou expandir o controle para mostrar todas as opções de valiosas) para acessar o conjunto completo de informações do item de dados.

When calling SetFocus on the UI Automation element for the data item, the Microsoft Windows Explorer case will return successfully and cause focus to be set to the Edit within the data item subtree.

Required UI Automation Events

The following table lists the UI Automation events required to be supported by all data item controls. For more information about events, see Visão geral sobre eventos de automação de interface do usuário.

UI Automation Event

Support

Notes

AutomationFocusChangedEvent

Required

None

BoundingRectangleProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

NameProperty property-changed event.

Required

None

StructureChangedEvent

Required

None

InvokedEvent

Depends

None

ExpandCollapseStateProperty property-changed event.

Depends

None

ElementAddedToSelectionEvent

Required

None

ElementRemovedFromSelectionEvent

Required

None

ElementSelectedEvent

Required

None

ToggleStateProperty property-changed event.

Depends

None

ValueProperty property-changed event.

Depends

None

DataItem Control Type Example

A imagem a seguir ilustra um tipo de controle DataItem em um controle de exibição de lista com suporte para obter informações detalhadas para as colunas.

Gráfico de um controle List View com dois itens de dados

The Control View and the Content View of the UI Automation tree that pertains to the data item control is displayed below. Os padrões de controle para cada elemento de automação são mostrados entre parênteses. O grupo "contoso" também é parte da grade de controle de host de grade de dados.

UI Automation Tree - Control View

UI Automation Tree - Content View

  • Grupo "Contoso" (Grade de tabela)

  • DataItem "Contas Receivable.doc" (Item de tabela, GridItem, SelectionItem, chamar)

  • Imagem "Contas Receivable.doc"

  • Editar o "Nome" (Valor do item de tabela, GridItem, "Contas Receivable.doc")

  • Editar a "Data de modificação" (Item de tabela, GridItem, o valor "25 de 8 de 2006 às 3:29 PM")

  • Editar "Tamanho" (GridItem, item de tabela, o valor "11.0 KB)

  • DataItem "Contas Payable.doc" (Item de tabela, GridItem, SelectionItem, chamar)

  • ...

  • Grupo "Contoso" (Grade de tabela)

  • DataItem "Contas Receivable.doc" (Item de tabela, GridItem, SelectionItem, chamar)

  • Imagem "Contas Receivable.doc"

  • Editar o "Nome" (Valor do item de tabela, GridItem, "Contas Receivable.doc")

  • Editar a "Data de modificação" (Item de tabela, GridItem, o valor "25 de 8 de 2006 às 3:29 PM")

  • Editar "Tamanho" (GridItem, item de tabela, o valor "11.0 KB)

  • DataItem "Contas Payable.doc" (Item de tabela, GridItem, SelectionItem, chamar)

Se uma grade representa uma lista de itens selecionáveis, os elementos de interface do usuário correspondentes podem ser expostos com o tipo de controle ListItem em vez do tipo de controle DataItem. No exemplo anterior, os elementos de DataItem ("contas Receivable.doc" e "Contas Payable.doc") em um grupo ("Contoso") pode ser melhorado, expondo-os como tipos de controle ListItem porque desse tipo já suporta o padrão de controle de SelectionItem.

Consulte também

Referência

DataItem

Conceitos

Visão Geral dos Tipos de Controle de Automação de Interface do Usuário

UI Automation Overview