Bagikan melalui


MouseGesture.MouseAction Properti

Definisi

Mendapatkan atau mengatur yang MouseAction terkait dengan gerakan ini.

public:
 property System::Windows::Input::MouseAction MouseAction { System::Windows::Input::MouseAction get(); void set(System::Windows::Input::MouseAction value); };
public System.Windows.Input.MouseAction MouseAction { get; set; }
member this.MouseAction : System.Windows.Input.MouseAction with get, set
Public Property MouseAction As MouseAction

Nilai Properti

Tindakan mouse yang terkait dengan gerakan ini. Nilai defaultnya adalah None.

Contoh

Contoh berikut menunjukkan untuk membuat MouseGesture dan mengaitkannya dengan RoutedCommand melalui MouseBinding.

MouseGesture OpenCmdMouseGesture = new MouseGesture();
OpenCmdMouseGesture.MouseAction = MouseAction.WheelClick;
OpenCmdMouseGesture.Modifiers = ModifierKeys.Control;

MouseBinding OpenCmdMouseBinding = new MouseBinding();
OpenCmdMouseBinding.Gesture = OpenCmdMouseGesture;
OpenCmdMouseBinding.Command = ApplicationCommands.Open;

this.InputBindings.Add(OpenCmdMouseBinding);
Dim OpenCmdMouseGesture As New MouseGesture()
OpenCmdMouseGesture.MouseAction = MouseAction.WheelClick
OpenCmdMouseGesture.Modifiers = ModifierKeys.Control

Dim OpenCmdMouseBinding As New MouseBinding()
OpenCmdMouseBinding.Gesture = OpenCmdMouseGesture
OpenCmdMouseBinding.Command = ApplicationCommands.Open

Me.InputBindings.Add(OpenCmdMouseBinding)

Keterangan

KeyGestureTidak seperti , MouseAction tidak harus dipasangkan dengan ModifierKeys agar menjadi validMouseGesture.

Berlaku untuk

Lihat juga