KeyBinding.Gesture Vlastnost

Definice

Získá nebo nastaví gesto přidružené k tomuto KeyBinding.

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

Hodnota vlastnosti

Posloupnost kláves. Výchozí hodnota je null.

Atributy

Výjimky

hodnota gesture je nastavena na není KeyGesture.

Příklady

Následující příklad ukazuje, jak vytvořit vazbu KeyGesture na RoutedCommand použití ( KeyBinding kód a příklady kódu určují různé klíče, ale jinak jsou ekvivalentní).

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

Poznámky

S výjimkou funkčních kláves a číselných klávesových KeyGesture kláves musí obsahovat a Key jeden nebo více ModifierKeys.

Platí pro

Viz také