Defines a mouse input gesture that can be used to invoke a command.
Namespace:System.Windows.Input Assembly:PresentationCore (in PresentationCore.dll) XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
A MouseGesture can be bound to a RoutedCommand (or other ICommand implementations) through a MouseBinding so that the command is invoked when the MouseGesture occurs.
For MouseGesture XAML attribute usages, the property that is generally set in XAML is Gesture, in cases where the gesture can represent both a mouse action and one or more modifier key. You can also set the Gesture property to be just a mouse action. In general, it is recommended that you use only the Gesture attribute from XAML, rather than setting MouseAction, even if you do not specify modifiers. This will avoid ambiguity, provides the most streamlined syntax, and provides the most straightforward representation for serialization.
MouseGesture XAML object element usages are possible but uncommon, because you can ordinarily set the Gesture property of MouseBinding inline without the use of property element syntax.
The following example shows to create a MouseGesture and associate it with a RoutedCommand through a MouseBinding. When the mouse wheel is clicked while the Control key is pressed, the Open is invoked.