SelectionItemPattern.SelectionContainerProperty Campo

Definición

Identifica la propiedad 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 

Valor de campo

Ejemplos

En el ejemplo siguiente se muestra cómo recuperar el AutomationElement que representa el contenedor de selección de un elemento de selección.

///--------------------------------------------------------------------
/// <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

Comentarios

Este identificador lo usan las aplicaciones cliente de Automatización de la interfaz de usuario. Automatización de la interfaz de usuario proveedores deben usar el campo equivalente en SelectionItemPatternIdentifiers.

Se aplica a