MouseBinding Constructor (ICommand, MouseGesture)

 

Initializes a new instance of the MouseBinding class, using the specified command and mouse gesture.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public MouseBinding(
	ICommand command,
	MouseGesture gesture
)

Parameters

command
Type: System.Windows.Input.ICommand

The command associated with the gesture.

gesture
Type: System.Windows.Input.MouseGesture

The gesture associated with the command.

The following example shows how to bind an ICommand with a MouseGesture using a MouseAction.

MouseGesture PasteCmdMouseGesture = new MouseGesture(
    MouseAction.MiddleClick, ModifierKeys.Alt);

ApplicationCommands.Paste.InputGestures.Add(PasteCmdMouseGesture);

.NET Framework
Available since 3.0
Return to top
Show: