Defines a mouse input gesture that can be used to invoke a command.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Thetype exposes the following members.
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Matches||Determines whether matches the input associated with the specified InputEventArgs object. (Overrides InputGesture.Matches(Object, InputEventArgs).)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
For 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 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);
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)