Partilhar via


MouseGesture.MouseAction Propriedade

Definição

Obtém ou define o MouseAction associado a esse gesto.

public:
 property System::Windows::Input::MouseAction MouseAction { System::Windows::Input::MouseAction get(); void set(System::Windows::Input::MouseAction value); };
public System.Windows.Input.MouseAction MouseAction { get; set; }
member this.MouseAction : System.Windows.Input.MouseAction with get, set
Public Property MouseAction As MouseAction

Valor da propriedade

A ação do mouse associada a esse gesto. O valor padrão é None.

Exemplos

O exemplo a seguir mostra como criar um MouseGesture e associá-lo a um RoutedCommand por meio de um 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);
Dim OpenCmdMouseGesture As New MouseGesture()
OpenCmdMouseGesture.MouseAction = MouseAction.WheelClick
OpenCmdMouseGesture.Modifiers = ModifierKeys.Control

Dim OpenCmdMouseBinding As New MouseBinding()
OpenCmdMouseBinding.Gesture = OpenCmdMouseGesture
OpenCmdMouseBinding.Command = ApplicationCommands.Open

Me.InputBindings.Add(OpenCmdMouseBinding)

Comentários

Ao contrário de um KeyGesture, um MouseAction não precisa ser emparelhado com ModifierKeys para ser um válido MouseGesture.

Aplica-se a

Confira também