Compartilhar via


Suporte de Automação de Interface de Usuário para o Tipo de Controle TreeItem

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 UI Automation suporte para o TreeItem o tipo de controle. In UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlTypeProperty property. As condições incluem as diretrizes específicas para UI Automation estrutura de árvore, UI Automation os valores de propriedade e padrões de controle.

The TreeItem control type represents a node within a tree container. Each node might contain other nodes, called child nodes. Parent nodes, or nodes that contain child nodes, can be displayed as expanded or collapsed.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the TreeItem control type. O UI Automation requisitos se aplicam a todos os controles de item de árvore, 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
  • Required UI Automation Events
  • 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 tree item controls and describes what can be contained in each view. For more information on the UI Automation tree, see Visão geral da árvore de automação de interface do usuário.

Control View

Content View

TreeItem

  • CheckBox (0 or 1)

  • Image (0 or 1)

  • Button (0 or 1)

  • TreeItem (0 or more)

TreeItem

  • TreeItem (0 or more)

Tree item controls can have zero or more tree item children in the content view of the UI Automation tree. If the tree item control has functionality beyond what is exposed in the control patterns listed below, then the control should be based on the Data Item control type.

Collapsed tree items will not display in the control view or content view until they become expanded and visible (or, can be scrolled into view).

O modo de exibição do controle pode conter detalhes adicionais para um controle, incluindo um botão ou uma imagem associada. Por exemplo, um item em um modo de exibição de estrutura de tópicos pode conter uma imagem como um botão para expandir ou recolher a estrutura de tópicos. Esses objetos de detalhes não aparecem no modo de exibição de conteúdo, porque as informações já são representadas por um item da árvore do pai. Tree items that are scrolled off the screen will appear in both the control and content views of the UI Automation tree and should have the IsOffscreenProperty set to true.

Required UI Automation Properties

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

UI Automation 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.

This property must return a location of the item that will cause the item to change selection state or become focused.

ControlTypeProperty

TreeItem

This value is the same for all UI frameworks.

IsContentElementProperty

True

The list control is always included in the content view of the UI Automation tree.

IsControlElementProperty

True

The list control is always included in the control view of the UI Automation tree.

IsOffscreenProperty

See notes.

This property is set to indicate when a tree item control is scrolled off the screen.

IsKeyboardFocusableProperty

See notes.

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

ItemTypeProperty

See notes.

If the tree item control uses a visual icon to indicate that is a particular type of object, then this property must be supported and indicate what the object is.

LabeledByProperty

Null

Tree item controls are self-labeling.

LocalizedControlTypeProperty

"tree item"

Localized string corresponding to the TreeItem control type.

NameProperty

See notes.

This property exposes the text displayed for each tree item control.

Required UI Automation Control Patterns

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

Control Pattern/Pattern Property

Support/Value

Notes

IInvokeProvider

Depends

Implement this control pattern if the tree item has a separate, actionable command.

IExpandCollapseProvider

Yes

All tree items can be expanded or collapsed.

ExpandCollapseState

Expanded, Collapsed, or Leaf Node

Tree items will be leaf nodes when they are not expanded or collapsed.

IScrollItemProvider

Depends

Implement this control pattern if the tree container supports the Scroll control pattern.

ISelectionItemProvider

Depends

Implement this control pattern if it is possible to have an active selection that is maintained when the user returns to the tree container.

SelectionContainer

Yes

This property will expose the same container for all items within the container.

IToggleProvider

Depends

Implemente esse padrão de controle se o item de árvore possui uma caixa de seleção associada.

Required UI Automation Events

The following table lists the UI Automation events required to be supported by all tree 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

ItemStatusProperty property-changed event.

Depends

None

NameProperty property-changed event.

Required

None

StructureChangedEvent

Required

None

ExpandCollapseStateProperty property-changed event.

Required

None

InvokedEvent

Depends

None

CurrentViewProperty property-changed event.

Depends

None

ElementAddedToSelectionEvent

Depends

None

ElementRemovedFromSelectionEvent

Depends

None

ElementSelectedEvent

Depends

None

ToggleStateProperty property-changed event.

Depends

None

ValueProperty property-changed event.

Depends

None

Consulte também

Referência

TreeItem

Conceitos

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

UI Automation Overview