Defines a mouse input gesture that can be used to invoke a command.
Assembly: PresentationCore (in PresentationCore.dll)
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
For 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.XAML attribute usages, the property that is generally set in XAML is
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);
Available since 3.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.