MouseBinding 构造函数

定义

初始化 MouseBinding 类的新实例。

重载

MouseBinding()

初始化 MouseBinding 类的新实例。

MouseBinding(ICommand, MouseGesture)

用指定的命令和鼠标笔势初始化 MouseBinding 类的新实例。

MouseBinding()

初始化 MouseBinding 类的新实例。

public:
 MouseBinding();
public MouseBinding ();
Public Sub New ()

另请参阅

适用于

MouseBinding(ICommand, MouseGesture)

用指定的命令和鼠标笔势初始化 MouseBinding 类的新实例。

public:
 MouseBinding(System::Windows::Input::ICommand ^ command, System::Windows::Input::MouseGesture ^ gesture);
public MouseBinding (System.Windows.Input.ICommand command, System.Windows.Input.MouseGesture gesture);
new System.Windows.Input.MouseBinding : System.Windows.Input.ICommand * System.Windows.Input.MouseGesture -> System.Windows.Input.MouseBinding
Public Sub New (command As ICommand, gesture As MouseGesture)

参数

command
ICommand

与该笔势关联的命令。

gesture
MouseGesture

与该命令关联的笔势。

示例

下面的示例演示如何使用 将 与 MouseGesture 绑定ICommandMouseAction

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

ApplicationCommands.Paste.InputGestures.Add(PasteCmdMouseGesture);
Dim PasteCmdMouseGesture As New MouseGesture(MouseAction.MiddleClick, ModifierKeys.Alt)

ApplicationCommands.Paste.InputGestures.Add(PasteCmdMouseGesture)

另请参阅

适用于