InputBinding.Gesture 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 입력 바인딩과 연결된 값을 가져오거나 설정합니다 InputGesture .
public:
virtual property System::Windows::Input::InputGesture ^ Gesture { System::Windows::Input::InputGesture ^ get(); void set(System::Windows::Input::InputGesture ^ value); };
public virtual System.Windows.Input.InputGesture Gesture { get; [System.Security.SecurityCritical] set; }
public virtual System.Windows.Input.InputGesture Gesture { get; set; }
[<set: System.Security.SecurityCritical>]
member this.Gesture : System.Windows.Input.InputGesture with get, set
member this.Gesture : System.Windows.Input.InputGesture with get, set
Public Overridable Property Gesture As InputGesture
속성 값
연결된 제스처입니다. 기본값은 null입니다.
- 특성
예제
다음 예제에서는 a KeyBinding 를 사용하여 에 바인딩하는 KeyGesture 방법을 보여 있습니다 RoutedCommand. ALT+L을 KeyGesture 누르면 명령이 Close 호출됩니다.
<KeyBinding Modifiers="Alt"
Key="L"
Command="ApplicationCommands.Close" />
KeyGesture CloseCmdKeyGesture = new KeyGesture(
Key.L, ModifierKeys.Alt);
KeyBinding CloseKeyBinding = new KeyBinding(
ApplicationCommands.Close, CloseCmdKeyGesture);
this.InputBindings.Add(CloseKeyBinding);
Dim CloseCmdKeyGesture As New KeyGesture(Key.L, ModifierKeys.Alt)
Dim CloseKeyBinding As New KeyBinding(ApplicationCommands.Close, CloseCmdKeyGesture)
Me.InputBindings.Add(CloseKeyBinding)
설명
입력 제스처는 명령을 호출하는 동작입니다. WPF 입력 제스처의 예는 KeyGesture 및 MouseGesture. A KeyGesture 는 a와 일련의 Key 조합입니다 ModifierKeys. A MouseGesture 는 a와 일련의 MouseAction 조합입니다 ModifierKeys.
InputBinding 클래스 자체는 공용 매개 변수가 없는 생성자를 노출하지 않으므로 XAML 사용을 지원하지 않습니다(매개 변수가 없는 생성자는 있지만 보호됨). 그러나 파생 클래스는 공용 생성자를 노출할 수 있으므로 XAML 사용으로 상속된 InputBinding 속성을 설정할 수 있습니다. XAML에서 인스턴스화할 수 있고 XAML에서 속성을 설정할 수 있는 두 개의 기존 InputBinding 파생 클래스는 다음과 KeyBinding같습니다MouseBinding.
XAML 특성 사용
<
KeyBinding
Gesture="KeyGesture"/>
-또는-
<
MouseBinding
Gesture="MouseGesture"/>
-또는-
<
inputBindingDerivedClass
Gesture="InputGesture"/>
XAML 속성 요소 사용
<inputBindingDerivedClass>
<inputBindingDerivedClass.Gesture>
<inputGestureImplementation/>
</inputBindingDerivedClass.Gesture>
</inputBindingDerivedClass>
XAML 값
inputBindingDerivedClass개체 요소 구문(예: InputBinding 또는 KeyBinding.)을 지원하는 파생 클래스 MouseBinding 입니다. 비고를 참조하세요.
inputGestureImplementation 개체 요소 구문을 지원하는 사용자 지정 파생 클래스 InputGesture 입니다.