ExpandCollapsePattern.ExpandCollapseStateProperty Feld

Definition

Gibt die ExpandCollapseState-Eigenschaft an.

public: static initonly System::Windows::Automation::AutomationProperty ^ ExpandCollapseStateProperty;
public static readonly System.Windows.Automation.AutomationProperty ExpandCollapseStateProperty;
 staticval mutable ExpandCollapseStateProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ExpandCollapseStateProperty As AutomationProperty 

Feldwert

AutomationProperty

Beispiele

Im folgenden Beispiel wird ein Stammelement an eine Funktion übergeben, die eine Auflistung von Benutzeroberflächenautomatisierung Elementen zurückgibt, die untergeordnete Elemente des Stamms sind und eine Reihe von Eigenschaftenbedingungen erfüllen.

///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy 
/// the specified condition(s).
/// </summary>
/// <param name="targetApp">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying 
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
    AutomationElement targetApp)
{
    if (targetApp == null)
    {
        throw new ArgumentException("Root element cannot be null.");
    }

    PropertyCondition conditionLeafNode =
        new PropertyCondition(
        ExpandCollapsePattern.ExpandCollapseStateProperty, 
        ExpandCollapseState.LeafNode);

    return targetApp.FindAll(
        TreeScope.Descendants, conditionLeafNode);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy 
''' the specified condition(s).
''' </summary>
''' <param name="targetApp">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying 
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal targetApp As AutomationElement) As AutomationElementCollection
    If targetApp Is Nothing Then
        Throw New ArgumentException("Root element cannot be null.")
    End If

    Dim conditionLeafNode As New PropertyCondition( _
    ExpandCollapsePattern.ExpandCollapseStateProperty, _
    ExpandCollapseState.LeafNode)

    Return targetApp.FindAll(TreeScope.Descendants, conditionLeafNode)

End Function 'FindAutomationElement

Hinweise

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

ExpandCollapseState verweist nur auf die Sichtbarkeit der unmittelbaren untergeordneten Objekte und nicht auf die Sichtbarkeit sämtlicher Nachfolgerobjekte.

Der Standardwert ist Expanded.

Gilt für

Siehe auch