Condividi tramite


MouseGesture.MouseAction Proprietà

Definizione

Ottiene o imposta l'oggetto MouseAction associato a questo movimento.

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

Valore della proprietà

L'azione del mouse associata a questo movimento. Il valore predefinito è None.

Esempio

Nell'esempio seguente viene illustrato come creare un oggetto MouseGesture e associarlo a un RoutedCommand tramite un oggetto 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)

Commenti

A differenza di , KeyGestureun MouseAction oggetto non deve essere associato a ModifierKeys per essere un oggetto valido MouseGesture.

Si applica a

Vedi anche