MouseAction Property
Collapse the table of content
Expand the table of content

MouseGesture.MouseAction Property

 

Gets or sets the MouseAction associated with this gesture.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public MouseAction MouseAction { get; set; }

Property Value

Type: System.Windows.Input.MouseAction

The mouse action associated with this gesture. The default value is None.

Unlike a KeyGesture, a MouseAction does not have to be paired with ModifierKeys in order to be a valid MouseGesture.

The following example shows to create a MouseGesture and associate it with a RoutedCommand through a 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);

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft