InputGestureCollection.Add(InputGesture) 메서드

정의

지정된 InputGesture 값을 이 InputGestureCollection에 추가합니다.

public:
 int Add(System::Windows::Input::InputGesture ^ inputGesture);
public int Add(System.Windows.Input.InputGesture inputGesture);
member this.Add : System.Windows.Input.InputGesture -> int
Public Function Add (inputGesture As InputGesture) As Integer

매개 변수

inputGesture
InputGesture

컬렉션에 추가할 제스처입니다.

반품

작업이 성공한 경우 0입니다(추가된 항목의 인덱스가 아님).

예외

컬렉션이 읽기 전용입니다.

제스처는 .입니다 null.

예제

다음 예제에서는 a를 KeyGesture 만들고 에 추가 InputGestureCollection 합니다 RoutedCommand.

<Window.InputBindings>
  <KeyBinding Key="B"
              Modifiers="Control" 
              Command="ApplicationCommands.Open" />
</Window.InputBindings>
KeyGesture OpenCmdKeyGesture = new KeyGesture(
    Key.B,
    ModifierKeys.Control);

ApplicationCommands.Open.InputGestures.Add(OpenCmdKeyGesture);
Dim OpenCmdKeyGesture As New KeyGesture(Key.B, ModifierKeys.Control)

ApplicationCommands.Open.InputGestures.Add(OpenCmdKeyGesture)

적용 대상

추가 정보