Share via


CanExecuteRoutedEventArgs.Parameter 속성

정의

명령별 데이터를 가져옵니다.

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

속성 값

명령 데이터입니다. 기본값은 null입니다.

예제

다음 예제에서는 사용자 지정 명령에 대 한 Button 명령 소스로 를 사용 하 여 표시 됩니다. 의 Button 속성은 Command 라는 customCommand 사용자 지정 RoutedCommand 으로 설정되고 CommandParameter 는 컨트롤의 Value 속성 Slider 값을 전달하는 데 사용됩니다. 이는 databinding을 사용하여 를 속성에 바인딩 CommandParameter 하는 것입니다 Value . 바인딩 식의 변환기는 에 바인딩CommandParameter하기 전에 로 Int32 변환 Value 하는 사용자 지정 IValueConverter 입니다.

<!-- The Command Source for the custom command-->
<!-- Passes Slider.Value as the CommandParameter-->
<Button Command="{x:Static custom:Window1.customCommand}" 
        Content="Command"
        CommandParameter="{Binding ElementName=secondSlider,
                            Path=Value,
                            Converter={StaticResource ValueConverterResource}}" 
        Margin="10"/>

설명

명령 매개 변수는 명령이 실행될 때 특정 정보를 명령에 전달하는 데 사용됩니다. 데이터 유형의 명령에 의해 정의 됩니다.

Parameter 은 일 null수 있습니다. 대부분의 명령은 명령 매개 변수를 처리하거나 기대하지 않습니다.

적용 대상

추가 정보