ExecutedRoutedEventArgs.Parameter プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コマンドのデータ パラメーターを取得します。
public:
property System::Object ^ Parameter { System::Object ^ get(); };
public object Parameter { get; }
member this.Parameter : obj
Public ReadOnly Property Parameter As Object
プロパティ値
コマンド固有のデータ。 既定値は null です。
例
次の例では、カスタム RoutedCommandのExecutedRoutedEventHandlerを作成します。 ハンドラーは、ExecutedRoutedEventArgs.Parameterを介してハンドラーに渡されるSlider コントロールの現在の時刻とValue プロパティを使用してTextBoxを更新します。
// 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
注釈
このプロパティは、特定のコマンドによって定義されるジェネリック データ パラメーターを表します。
このパラメーターが必要ない場合は、 null を渡すことができます。
通常、 Parameter は、実行時に特定の情報をコマンドに渡すために使用されます。 データの型は、コマンドによって定義されます。