SelectionItemPattern.SelectionContainerProperty Campo
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Identifica a propriedade SelectionContainer.
public: static initonly System::Windows::Automation::AutomationProperty ^ SelectionContainerProperty;
public static readonly System.Windows.Automation.AutomationProperty SelectionContainerProperty;
staticval mutable SelectionContainerProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly SelectionContainerProperty As AutomationProperty
O exemplo a seguir mostra como recuperar o AutomationElement contêiner de seleção de um item de seleção.
///--------------------------------------------------------------------
/// <summary>
/// Retrieves the selection items for a selection container.
/// </summary>
/// <param name="rootElement">
/// The automation element from which to start searching.
/// </param>
/// <param name="selectionContainer">
/// An automation element that supports SelectionPattern.
/// </param>
/// <returns>
/// A collection of automation elements satisfying
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindElementBasedOnContainer(
AutomationElement rootElement, AutomationElement selectionContainer)
{
PropertyCondition containerCondition =
new PropertyCondition(
SelectionItemPattern.SelectionContainerProperty,
selectionContainer);
AutomationElementCollection selectionItems =
rootElement.FindAll(TreeScope.Descendants, containerCondition);
return selectionItems;
}
'''--------------------------------------------------------------------
''' <summary>
''' Retrieves the selection items for a selection container.
''' </summary>
''' <param name="rootElement">
''' The automation element from which to start searching.
''' </param>
''' <param name="selectionContainer">
''' An automation element that supports SelectionPattern.
''' </param>
''' <returns>
''' A collection of automation elements satisfying
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindElementBasedOnContainer( _
ByVal rootElement As AutomationElement, _
ByVal selectionContainer As AutomationElement) As AutomationElementCollection
Dim containerCondition As PropertyCondition = _
New PropertyCondition( _
SelectionItemPattern.SelectionContainerProperty, _
selectionContainer)
Dim selectionItems As AutomationElementCollection = _
rootElement.FindAll(TreeScope.Descendants, containerCondition)
Return selectionItems
End Function
Esse identificador é usado por aplicativos cliente Automação da Interface do Usuário. Automação da Interface do Usuário provedores devem usar o campo equivalente em SelectionItemPatternIdentifiers.