KeyBinding.Gesture Tulajdonság

Definíció

Lekéri vagy beállítja az ehhez KeyBindingtársított kézmozdulatot.

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

Tulajdonság értéke

A kulcsütemezés. Az alapértelmezett érték a null.

Attribútumok

Kivételek

a beállított érték gesture nem egy KeyGesture.

Példák

Az alábbi példa bemutatja, hogyan köthet hozzá egy KeyGesture felhasználót RoutedCommandKeyBinding (a korrektúra és a kód példák különböző kulcsokat adnak meg, de más módon egyenértékűek).

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

Megjegyzések

A függvénykulcsok és a numerikus billentyűzetbillentyűk kivételével a függvénykulcsnak tartalmaznia kell egy KeyGesture és egy vagy több KeygombotModifierKeys.

A következőre érvényes:

Lásd még