MouseGesture (Clase)
TOC
Collapse the table of content
Expand the table of content

MouseGesture (Clase)

Defines a mouse input gesture that can be used to invoke a command.

Espacio de nombres: System.Windows.Input
Ensamblado: PresentationCore (en presentationcore.dll)
Espacio de nombres XML:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[TypeConverterAttribute(typeof(MouseGestureConverter))] 
public class MouseGesture : InputGesture
/** @attribute TypeConverterAttribute(System.Windows.Input.MouseGestureConverter) */ 
public class MouseGesture extends InputGesture
TypeConverterAttribute(System.Windows.Input.MouseGestureConverter) 
public class MouseGesture extends InputGesture
<object property="mouseAction"/>
- or -
<object property="oneOrMoreModifierKeys"/>
- or -
<object property="mouseAction+oneOrMoreModifierKeys"/>

 mouseAction   MouseAction  A single mouse action.  For more information, see the MouseAction property.  oneOrMoreModifierKeys  One or more modifier keys, defined by the ModifierKeys enumeration, delimited with a "+" character.  For more information, see the Modifiers property. 

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

A MouseGesture can be bound to an ICommand through a MouseBinding so that the command is invoked when the MouseGesture occurs.

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.

<MouseBinding Gesture="Control+WheelClick"
              Command="ApplicationCommands.Open" />

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);

System.Object
   System.Windows.Input.InputGesture
    System.Windows.Input.MouseGesture

Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0

Adiciones de comunidad

AGREGAR
Mostrar:
© 2016 Microsoft