RoutedCommand 클래스

정의

ICommand 를 구현하는 명령을 정의하고 요소 트리를 통해 라우트됩니다.

public ref class RoutedCommand : System::Windows::Input::ICommand
[System.ComponentModel.TypeConverter("System.Windows.Input.CommandConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
public class RoutedCommand : System.Windows.Input.ICommand
[System.ComponentModel.TypeConverter("System.Windows.Input.CommandConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
public class RoutedCommand : System.Windows.Input.ICommand
[<System.ComponentModel.TypeConverter("System.Windows.Input.CommandConverter, PresentationFramework, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")>]
type RoutedCommand = class
    interface ICommand
[<System.ComponentModel.TypeConverter("System.Windows.Input.CommandConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")>]
type RoutedCommand = class
    interface ICommand
Public Class RoutedCommand
Implements ICommand
상속
RoutedCommand
파생
특성
구현

설명

합니다 ExecuteCanExecute 메서드를 RoutedCommand 일반적인 경우 처럼 명령에 대 한 애플리케이션 논리가 포함 되어 있지 않습니다 ICommand, 하지만 이러한 방법을 사용 하 여 개체를 찾는 요소 트리를 탐색 하는 이벤트를 발생 하는 아니라는 CommandBinding. 에 연결된 CommandBinding 이벤트 처리기에는 명령 논리가 포함됩니다.

메서드는 ExecuteExecuted 이벤트를 발생합니다PreviewExecuted. 메서드는 CanExecuteCanExecute 이벤트를 발생합니다PreviewCanExecute.

XAML 특성 사용

<object-property="predefined-command-name"/>
-or-
<object-property="predefined-class-name.predefined-command-name"/>
-or-
<object-property="{custom-class-name.custom-command-name}"/>

XAML 값

predefined-class-name
미리 정의된 명령 클래스 중 하나입니다.

predefined-command-name
미리 정의된 명령 중 하나입니다.

custom-class-name
사용자 지정 명령을 포함하는 사용자 지정 클래스입니다. 사용자 지정 클래스에는 일반적으로 접두사 매핑이 xlmns 필요합니다. 자세한 내용은 XAML 네임 스페이스 및 WPF XAML에 대 한 매핑 Namespace합니다.

custom-command-name
사용자 지정 명령입니다.

생성자

RoutedCommand()

RoutedCommand 클래스의 새 인스턴스를 초기화합니다.

RoutedCommand(String, Type)

지정된 이름 및 소유자 유형을 사용하여 RoutedCommand 클래스의 새 인스턴스를 초기화합니다.

RoutedCommand(String, Type, InputGestureCollection)

지정된 이름, 소유자 형식 및 제스처 컬렉션을 사용하여 RoutedCommand 클래스의 새 인스턴스를 초기화합니다.

속성

InputGestures

이 명령과 연결된 InputGesture 개체의 컬렉션을 가져옵니다.

Name

명령의 이름을 가져옵니다.

OwnerType

명령에 등록된 형식을 가져옵니다.

메서드

CanExecute(Object, IInputElement)

RoutedCommand가 현재 상태에서 실행될 수 있는지 여부를 확인합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
Execute(Object, IInputElement)

현재 명령 대상에서 RoutedCommand를 실행합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

이벤트

CanExecuteChanged

명령 관리자가 명령 소스에 대한 변경 내용을 감지하는 경우 발생합니다. 이러한 변경 내용은 대개 현재 명령 대상에서 명령을 실행해야 하는지 여부에 영향을 줍니다.

명시적 인터페이스 구현

ICommand.CanExecute(Object)

이 멤버에 대한 설명은 CanExecute(Object)를 참조하십시오.

ICommand.Execute(Object)

이 멤버에 대한 설명은 Execute(Object)를 참조하십시오.

적용 대상

추가 정보