SelectionItemPattern.SelectionContainerProperty Feld

Definition

Gibt die SelectionContainer-Eigenschaft an.

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 

Feldwert

Beispiele

Im folgenden Beispiel wird gezeigt, wie sie den AutomationElement Auswahlcontainer eines Auswahlelements darstellt.

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

Hinweise

Dieser Bezeichner wird von Benutzeroberflächenautomatisierung Clientanwendungen verwendet. Benutzeroberflächenautomatisierung Anbieter sollten das entsprechende Feld in SelectionItemPatternIdentifiersverwenden.

Gilt für: