RoutedCommand 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
요소 트리를 통해 구현되고 라우팅되는 명령을 정의합니다 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
- 파생
- 특성
- 구현
설명
Execute 일반적인 경우ICommand와 마찬가지로 명령에 대한 RoutedCommand 애플리케이션 논리와 CanExecute 메서드는 포함되지 않지만, 이러한 메서드는 개체를 찾는 CommandBinding요소 트리를 트래버스하는 이벤트를 발생합니다. 명령 논리 포함에 CommandBinding 연결된 이벤트 처리기입니다.
이 메서드는 Execute 이벤트 및 PreviewExecuted 이벤트를 Executed 발생합니다. 이 메서드는 CanExecute 이벤트 및 PreviewCanExecute 이벤트를 CanExecute 발생합니다.
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 필요합니다. 자세한 내용은 WPF XAML에 대한 XAML 네임스페이스 및 네임스페이스 매핑을 참조하세요.
custom-command-name
사용자 지정 명령입니다.
생성자
| Name | Description |
|---|---|
| RoutedCommand() |
RoutedCommand 클래스의 새 인스턴스를 초기화합니다. |
| RoutedCommand(String, Type, InputGestureCollection) |
지정된 이름, 소유자 유형 및 제스처 컬렉션을 사용하여 클래스의 새 인스턴스 RoutedCommand 를 초기화합니다. |
| RoutedCommand(String, Type) |
지정된 이름 및 소유자 형식을 RoutedCommand 사용하여 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| InputGestures |
이 명령과 연결된 개체의 InputGesture 컬렉션을 가져옵니다. |
| Name |
명령의 이름을 가져옵니다. |
| OwnerType |
명령에 등록된 형식을 가져옵니다. |
메서드
| Name | Description |
|---|---|
| CanExecute(Object, IInputElement) |
현재 RoutedCommand 상태에서 실행할 수 있는지 여부를 결정합니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| Execute(Object, IInputElement) |
현재 명령 대상에서 실행합니다 RoutedCommand . |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
이벤트
| Name | Description |
|---|---|
| CanExecuteChanged |
명령 관리자가 명령 원본에 대한 변경 내용을 검색할 때 발생합니다. 이러한 변경 내용은 종종 명령이 현재 명령 대상에서 실행되어야 하는지 여부에 영향을 미칩니다. |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| ICommand.CanExecute(Object) |
이 멤버에 대한 설명은 CanExecute(Object)참조하세요. |
| ICommand.Execute(Object) |
이 멤버에 대한 설명은 Execute(Object)참조하세요. |