AutomationElement.IsContentElementProperty Campo

Definizione

Identifica la proprietà IsContentElement.

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

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà . Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

bool isContent = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty);
Dim isContent As Boolean = CBool(autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty))

Nell'esempio seguente viene recuperato il valore corrente della proprietà , ma viene specificato che se l'elemento stesso non fornisce un valore per la proprietà , NotSupported deve essere restituito anziché un valore predefinito.

bool isContent1;
object isContentNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty, true);
if (isContentNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    isContent1 = (bool)isContentNoDefault;
}
Dim isContent1 As Boolean
Dim isContentNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty, True)
If isContentNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    isContent1 = CBool(isContentNoDefault)
End If

Commenti

Questo identificatore viene usato da Automazione interfaccia utente applicazioni client. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

La visualizzazione contenuto dell'albero Automazione interfaccia utente fornisce una visualizzazione dell'interfaccia utente che contiene solo elementi che rappresentano i dati all'interno dell'interfaccia utente.

Un elemento deve essere un controllo in grado di contenere il contenuto.

I valori restituiti della proprietà sono di tipo Boolean. Il valore predefinito per la proprietà è true.

Si applica a

Vedi anche