InputGestureCollection.Add(InputGesture) Yöntem

Tanım

Belirtilen InputGesture öğesini bu InputGestureCollectionöğesine ekler.

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

Parametreler

inputGesture
InputGesture

Koleksiyona ekleme hareketi.

Döndürülenler

0, işlem başarılı olursa (bunun eklenen öğenin dizini olmadığını unutmayın).

Özel durumlar

koleksiyon salt okunurdur.

hareketi şeklindedir null.

Örnekler

Aşağıdaki örnek bir KeyGesture oluşturur ve öğesinin InputGestureCollection öğesine RoutedCommandekler.

<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)

Şunlara uygulanır

Ayrıca bkz.