ValuePattern.ValueProperty Campo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Identifica la proprietà Value.
public: static initonly System::Windows::Automation::AutomationProperty ^ ValueProperty;
public static readonly System.Windows.Automation.AutomationProperty ValueProperty;
staticval mutable ValueProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly ValueProperty As AutomationProperty
Valore del campo
Esempio
Nell'esempio seguente viene passato un ValuePattern oggetto ottenuto da un controllo di destinazione in una funzione che recupera i valori correnti ValuePattern della proprietà.
///--------------------------------------------------------------------
/// <summary>
/// Gets the current property values from target.
/// </summary>
/// <param name="valuePattern">
/// A ValuePattern control pattern obtained from
/// an automation element representing a target control.
/// </param>
/// <param name="automationProperty">
/// The automation property of interest.
/// </param>
///--------------------------------------------------------------------
private object GetValueProperty(
ValuePattern valuePattern,
AutomationProperty automationProperty)
{
if (valuePattern == null || automationProperty == null)
{
throw new ArgumentNullException("Argument cannot be null.");
}
if (automationProperty.Id ==
ValuePattern.ValueProperty.Id)
{
return valuePattern.Current.Value;
}
return null;
}
'''--------------------------------------------------------------------
''' <summary>
''' Gets the current property values from target.
''' </summary>
''' <param name="valuePattern">
''' A ValuePattern control pattern obtained from
''' an automation element representing a target control.
''' </param>
''' <param name="automationProperty">
''' The automation property of interest.
''' </param>
'''--------------------------------------------------------------------
Private Function GetValueProperty( _
ByVal valuePattern As ValuePattern, _
ByVal automationProperty As AutomationProperty) As Object
If (valuePattern Is Nothing Or automationProperty Is Nothing) Then
Throw New ArgumentNullException("Argument cannot be null.")
End If
If automationProperty.Id = valuePattern.ValueProperty.Id Then
Return valuePattern.Current.Value
End If
Return Nothing
End Function 'GetValueProperty
Commenti
Questo identificatore viene usato da Automazione interfaccia utente applicazioni client. Automazione interfaccia utente provider devono usare il campo equivalente in ValuePatternIdentifiers.