Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MouseGesture.MouseAction Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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:
© 2018 Microsoft