Aracılığıyla paylaş


MouseBinding.Gesture Özellik

Tanım

Bu MouseBindingile ilişkili hareketi alır veya ayarlar.

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

Özellik Değeri

Hareket.

Öznitelikler

Özel durumlar

Gesture olarak ayarlanır null.

Örnekler

Aşağıdaki örnekte, arasında MouseGesture bir bağlamanın nasıl oluşturulacağı gösterilmektedir RoutedCommand.

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

Açıklamalar

A MouseGesture , MouseAction ile veya kümesi olmadan şeklindedir ModifierKeys. ' KeyGesturenin aksine, MouseGesture ile ilişkilendirilmiş bir değiştirici anahtarı olması gerekmez.

Şunlara uygulanır

Ayrıca bkz.