InputBinding 생성자
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
InputBinding 클래스의 새 인스턴스를 초기화합니다.
오버로드
| Name | Description |
|---|---|
| InputBinding() |
에서 파생된 InputBinding클래스에 대한 기본 초기화를 제공합니다. |
| InputBinding(ICommand, InputGesture) |
지정된 명령 및 입력 제스처를 InputBinding 사용하여 클래스의 새 인스턴스를 초기화합니다. |
InputBinding()
에서 파생된 InputBinding클래스에 대한 기본 초기화를 제공합니다.
protected:
InputBinding();
protected InputBinding();
Protected Sub New ()
설명
InputBinding 는 기술적으로 추상 클래스가 아니지만 매개 변수가 없는 생성자는 의도적으로 액세스를 보호합니다. XAML에 대한 "추상" 클래스를 만드는 InputBinding 효과가 있습니다. WPF InputBinding 형식의 개체를 예상하지만 XAML에서 InputBinding 인스턴스를 지정할 수 없는 XAML 사용이 있는 기존 속성이 있습니다. 대신 디바이스별 InputBinding 파생 클래스 중 하나를 값으로 지정할 수 있습니다(예: 또는 KeyBindingMouseBinding.).
상속자 참고
XAML 사용을 지원하는 사용자 지정 InputBinding 을 구현하는 경우 기본 초기화에 이 생성자를 사용합니다.
적용 대상
InputBinding(ICommand, InputGesture)
지정된 명령 및 입력 제스처를 InputBinding 사용하여 클래스의 새 인스턴스를 초기화합니다.
public:
InputBinding(System::Windows::Input::ICommand ^ command, System::Windows::Input::InputGesture ^ gesture);
[System.Security.SecurityCritical]
public InputBinding(System.Windows.Input.ICommand command, System.Windows.Input.InputGesture gesture);
public InputBinding(System.Windows.Input.ICommand command, System.Windows.Input.InputGesture gesture);
[<System.Security.SecurityCritical>]
new System.Windows.Input.InputBinding : System.Windows.Input.ICommand * System.Windows.Input.InputGesture -> System.Windows.Input.InputBinding
new System.Windows.Input.InputBinding : System.Windows.Input.ICommand * System.Windows.Input.InputGesture -> System.Windows.Input.InputBinding
Public Sub New (command As ICommand, gesture As InputGesture)
매개 변수
- command
- ICommand
연결할 명령입니다 gesture.
- gesture
- InputGesture
연결할 입력 제스처입니다 command.
- 특성
예외
command 또는 gesture .입니다 null.
예제
다음 예제에서는이 생성자를 사용 하 여 연결 KeyGesture 하는 방법을 보여 있습니다 RoutedCommand.
KeyGesture HelpCmdKeyGesture = new KeyGesture(Key.H,
ModifierKeys.Alt);
InputBinding inputBinding;
inputBinding = new InputBinding(ApplicationCommands.Help,
HelpCmdKeyGesture);
this.InputBindings.Add(inputBinding);
Dim HelpCmdKeyGesture As New KeyGesture(Key.H, ModifierKeys.Alt)
Dim inputBinding As InputBinding
inputBinding = New InputBinding(ApplicationCommands.Help, HelpCmdKeyGesture)
Me.InputBindings.Add(inputBinding)
설명
기존 입력 바인딩 클래스를 사용하는 소프트웨어 개발자인 경우 사용자 지정 명령을 정의하는 경우에도 일반적으로 이 생성자를 사용하지 않습니다. 대신 파생 클래스(KeyBinding 및 MouseBinding)의 생성자를 사용하거나 이 생성자를 사용자 지정 클래스의 기본 인스턴스화로 사용합니다. 클래스는 InputBinding 원칙에 따라 다른 입력 디바이스를 지원하지만 실제로는 입력 바인딩이 나타낼 디바이스를 선택해야 합니다. 입력 바인딩에서 하나의 Gesture 값만 설정할 수 있으며 제스처는 디바이스별로 다릅니다.