KeyBinding.Gesture Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém ou define o gesto associado a este 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
Valor de Propriedade
A sequência de chaves. O valor predefinido é null.
- Atributos
Exceções
o valor gesture que está a ser definido para não é um KeyGesture.
Exemplos
O exemplo seguinte mostra como associar a KeyGesture a RoutedCommand a usando a KeyBinding (os exemplos de marcação e código especificam chaves diferentes, mas são de resto equivalentes).
<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)
Observações
Com exceção das teclas de função e das teclas numéricas do teclado, a KeyGesture deve conter a Key e uma ou mais ModifierKeys.