KeyBinding.Gesture 속성

정의

KeyBinding동작과 연결된 제스처를 가져오거나 설정합니다.

public:
 virtual property System::Windows::Input::InputGesture ^ Gesture { System::Windows::Input::InputGesture ^ get(); void set(System::Windows::Input::InputGesture ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Windows.Input.KeyGestureConverter))]
public override System.Windows.Input.InputGesture Gesture { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Input.KeyGestureConverter))>]
member this.Gesture : System.Windows.Input.InputGesture with get, set
Public Overrides Property Gesture As InputGesture

속성 값

키 시퀀스입니다. 기본값은 null입니다.

특성

예외

gesture 이 설정되고 있는 값이 아닙니다 KeyGesture.

예제

다음 예제에서는 using a KeyGestureRoutedCommand 에 바인딩하는 KeyBinding 방법을 보여 줍니다(태그 및 코드 예제는 다른 키를 지정하지만 그렇지 않으면 동일).

<Window.InputBindings>
  <KeyBinding Command="ApplicationCommands.Open"
              Gesture="CTRL+R" />
</Window.InputBindings>
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)

설명

함수 키와 숫자 키패드 키를 제외하고 하나 KeyGesture 이상의 Key키를 포함 ModifierKeys 해야 합니다.

적용 대상

추가 정보