ExecutedRoutedEventArgs.Parameter Właściwość

Definicja

Pobiera parametr danych polecenia.

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

Wartość właściwości

Dane specyficzne dla polecenia. Wartość domyślna to null.

Przykłady

Poniższy przykład tworzy element ExecutedRoutedEventHandler dla niestandardowego RoutedCommandelementu . Procedura obsługi aktualizuje TextBox element o bieżącej godzinie i Value właściwość Slider kontrolki przekazanej do programu obsługi za pośrednictwem ExecutedRoutedEventArgs.Parameterelementu .

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

Uwagi

Ta właściwość reprezentuje ogólny parametr danych zdefiniowany przez określone polecenie.

Jeśli ten parametr nie jest potrzebny, null można przekazać go.

Parameter Zwykle element jest używany do przekazywania określonych informacji do polecenia po jego wykonaniu. Typ danych jest definiowany przez polecenie .

Dotyczy

Zobacz też