InputGestureCollection.Add(InputGesture) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
지정된 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)