KeyGesture 생성자

정의

KeyGesture 클래스의 새 인스턴스를 초기화합니다.

오버로드

KeyGesture(Key)

지정된 KeyGesture를 사용하여 Key 클래스의 새 인스턴스를 초기화합니다.

KeyGesture(Key, ModifierKeys)

지정된 KeyGestureKey를 사용하여 ModifierKeys 클래스의 새 인스턴스를 초기화합니다.

KeyGesture(Key, ModifierKeys, String)

지정한 KeyGesture, Key와 표시 문자열을 사용하여 ModifierKeys 클래스의 새 인스턴스를 초기화합니다.

KeyGesture(Key)

지정된 KeyGesture를 사용하여 Key 클래스의 새 인스턴스를 초기화합니다.

public:
 KeyGesture(System::Windows::Input::Key key);
public KeyGesture (System.Windows.Input.Key key);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key -> System.Windows.Input.KeyGesture
Public Sub New (key As Key)

매개 변수

key
Key

이 제스처와 연결된 키입니다.

예외

key은 유효한 Key이 아닙니다.

key은 유효한 KeyGesture이 아닙니다.

예제

다음 예제에서는 만들려면이 생성자를 사용 하는 방법을 보여 줍니다를 KeyGesture 와 연결 된 KeyBinding. KeyBinding 에 추가 되는 InputBindingCollectionWindow합니다.

KeyGesture OpenCmdKeyGesture = new KeyGesture(Key.F12);
KeyBinding OpenKeyBinding = new KeyBinding(
    ApplicationCommands.Open,
    OpenCmdKeyGesture);

this.InputBindings.Add(OpenKeyBinding);
Dim OpenCmdKeyGesture As New KeyGesture(Key.F12)
Dim OpenKeyBinding As New KeyBinding(ApplicationCommands.Open, OpenCmdKeyGesture)

Me.InputBindings.Add(OpenKeyBinding)

설명

대부분의 경우에는 KeyGesture 하나를 사용 하 여 연결 해야 ModifierKeys합니다. 이 규칙에 대 한 예외는 기능 키와 숫자 키패드의 키를 유효한 수 KeyGesture 자체적으로 합니다.

추가 정보

적용 대상

KeyGesture(Key, ModifierKeys)

지정된 KeyGestureKey를 사용하여 ModifierKeys 클래스의 새 인스턴스를 초기화합니다.

public:
 KeyGesture(System::Windows::Input::Key key, System::Windows::Input::ModifierKeys modifiers);
public KeyGesture (System.Windows.Input.Key key, System.Windows.Input.ModifierKeys modifiers);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key * System.Windows.Input.ModifierKeys -> System.Windows.Input.KeyGesture
Public Sub New (key As Key, modifiers As ModifierKeys)

매개 변수

key
Key

제스처와 연결된 키입니다.

modifiers
ModifierKeys

제스처와 연결된 보조키입니다.

예외

modifiers는 유효한 ModifierKeys가 아닙니다.

또는

key은 유효한 Key이 아닙니다.

keymodifiers가 유효한 KeyGesture를 만들지 않는 경우

예제

다음 예제에서는 만들려면이 생성자를 사용 하는 방법을 보여 줍니다를 KeyGesture 와 연결 된 KeyBinding. KeyBinding 에 추가 되는 InputBindingCollectionWindow합니다.

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 하나를 사용 하 여 연결 해야 ModifierKeys합니다. 이 규칙에 대 한 예외는 기능 키와 숫자 키패드의 키를 유효한 수 KeyGesture 자체적으로 합니다.

추가 정보

적용 대상

KeyGesture(Key, ModifierKeys, String)

지정한 KeyGesture, Key와 표시 문자열을 사용하여 ModifierKeys 클래스의 새 인스턴스를 초기화합니다.

public:
 KeyGesture(System::Windows::Input::Key key, System::Windows::Input::ModifierKeys modifiers, System::String ^ displayString);
public KeyGesture (System.Windows.Input.Key key, System.Windows.Input.ModifierKeys modifiers, string displayString);
new System.Windows.Input.KeyGesture : System.Windows.Input.Key * System.Windows.Input.ModifierKeys * string -> System.Windows.Input.KeyGesture
Public Sub New (key As Key, modifiers As ModifierKeys, displayString As String)

매개 변수

key
Key

제스처와 연결된 키입니다.

modifiers
ModifierKeys

제스처와 연결된 보조키입니다.

displayString
String

KeyGesture의 문자열 표현입니다.

예외

modifiers는 유효한 ModifierKeys가 아닙니다.

또는

key은 유효한 Key이 아닙니다.

displayString이(가) null인 경우

keymodifiers가 유효한 KeyGesture를 만들지 않는 경우

설명

합니다 DisplayString 속성을 displayString 매개 변수입니다.

추가 정보

적용 대상