Sdílet prostřednictvím


MouseBinding.Gesture Vlastnost

Definice

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

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.MouseGestureConverter))]
public override System.Windows.Input.InputGesture Gesture { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Input.MouseGestureConverter))>]
member this.Gesture : System.Windows.Input.InputGesture with get, set
Public Overrides Property Gesture As InputGesture

Hodnota vlastnosti

Gesto.

Atributy

Výjimky

Gesture je nastavená na nullhodnotu .

Příklady

Následující příklad ukazuje, jak vytvořit vazbu mezi objektem MouseGestureRoutedCommandna .

<MouseBinding Gesture="Alt+MiddleClick"
              Command="ApplicationCommands.New" />
MouseGesture NewCmdMouseGesture = new MouseGesture();
NewCmdMouseGesture.Modifiers = ModifierKeys.Alt;
NewCmdMouseGesture.MouseAction = MouseAction.MiddleClick;

MouseBinding NewMouseBinding = new MouseBinding();
NewMouseBinding.Command = ApplicationCommands.New;
NewMouseBinding.Gesture = NewCmdMouseGesture;

// RootWindow is an instance of Window.
RootWindow.InputBindings.Add(NewMouseBinding);
Dim NewCmdMouseGesture As New MouseGesture()
NewCmdMouseGesture.Modifiers = ModifierKeys.Alt
NewCmdMouseGesture.MouseAction = MouseAction.MiddleClick

Dim NewMouseBinding As New MouseBinding()
NewMouseBinding.Command = ApplicationCommands.[New]
NewMouseBinding.Gesture = NewCmdMouseGesture

' RootWindow is an instance of Window.
RootWindow.InputBindings.Add(NewMouseBinding)

Poznámky

A MouseGesture je se MouseAction sadou ModifierKeysnebo bez sady . KeyGestureNa rozdíl od , MouseGesture nemusí mít klíč modifikačního klíče přidružený.

Platí pro

Viz také