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
입니다.
- 특성
예제
다음 예제에서는 사용 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의 입력 제스처의 예는 및 MouseGesture입니다KeyGesture. KeyGesture 은 와 집합의 Key 조합입니다ModifierKeys. MouseGesture 은 와 집합의 MouseAction 조합입니다ModifierKeys.
InputBinding 클래스 자체는 공용 매개 변수 없는 생성자를 노출하지 않기 때문에 XAML 사용을 지원하지 않습니다(매개 변수가 없는 생성자는 있지만 보호됨). 그러나 파생 클래스는 공용 생성자를 노출할 수 있으므로 XAML 사용으로 에서 InputBinding 상속되는 속성을 설정할 수 있습니다. XAML에서 인스턴스화할 수 있고 XAML에서 속성을 설정할 수 있는 두 개의 기존 InputBinding 파생 클래스는 및 MouseBinding입니다KeyBinding.
XAML 특성 사용
<KeyBindingGesture
="KeyGesture"/>
또는
<MouseBindingGesture
="MouseGesture"/>
또는
<inputBindingDerivedClass
Gesture
="InputGesture"/>
XAML 속성 요소 사용
<inputBindingDerivedClass>
<inputBindingDerivedClass.Gesture>
<inputGestureImplementation/>
</inputBindingDerivedClass.Gesture>
</inputBindingDerivedClass>
XAML 값
inputBindingDerivedClass
또는 MouseBinding와 같은 KeyBinding 개체 요소 구문을 지원하는 의 InputBinding 파생 클래스입니다. 설명 부분을 참조하세요.
inputGestureImplementation
개체 요소 구문을 지원하는 의 InputGesture 사용자 지정 파생 클래스입니다.
적용 대상
추가 정보
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기