Nyelv

ExecutedRoutedEventArgs.Parameter Tulajdonság

Definíció

Lekéri a parancs adatparaméterét.

public:
 property System::Object ^ Parameter { System::Object ^ get(); };
public object Parameter { get; }
member this.Parameter : obj
Public ReadOnly Property Parameter As Object

Tulajdonság értéke

A parancsspecifikus adatok. Az alapértelmezett érték a null.

Példák

Az alábbi példa létrehoz egy ExecutedRoutedEventHandler egyénit RoutedCommand. A kezelő frissíti TextBox az aktuális időpontot és egy ValueSlider vezérlő tulajdonságát, amelyet a kezelő ExecutedRoutedEventArgs.Parametera .

//  Executed Event Handler
//
//  Updates the output TextBox with the current seconds 
//  and the target second, which is passed through Args.Parameter.
private void CustomCommandExecuted(object sender, ExecutedRoutedEventArgs e)
{
    txtResults.Text = "Command Executed at " +
        DateTime.Now.Second + " seconds after the minute \n\n" +
        "The target second is set to " +
        e.Parameter;
}
'  Executed Event Handler
'
'  Updates the output TextBox with the current seconds 
'  and the target second, which is passed through Args.Parameter.
Private Sub CustomCommandExecuted(ByVal sender As Object, ByVal e As ExecutedRoutedEventArgs)
    txtResults.Text = "Command Executed at " & Date.Now.Second & " seconds after the minute " & vbLf & vbLf & "The target second is set to " & e.Parameter.ToString()
End Sub

Megjegyzések

Ez a tulajdonság egy általános adatparamétert jelöl, amelyet az adott parancs határoz meg.

Ha ez a paraméter nem szükséges, null átadható.

A parancsot általában arra Parameter használják, hogy a parancs végrehajtásakor adott információkat adjon át. Az adatok típusát a parancs határozza meg.

A következőre érvényes:

Lásd még