KeyBinding 建構函式

定義

初始化 KeyBinding 類別的新執行個體。

多載

KeyBinding()

初始化 KeyBinding 類別的新執行個體。

KeyBinding(ICommand, KeyGesture)

使用指定的 KeyBindingICommand,初始化 KeyGesture 類別的新執行個體。

KeyBinding(ICommand, Key, ModifierKeys)

使用指定的 KeyBinding,和指定的 ICommandKey (將轉換為 ModifierKeys),初始化 KeyGesture 類別的新執行個體。

KeyBinding()

初始化 KeyBinding 類別的新執行個體。

C#
public KeyBinding();

另請參閱

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

KeyBinding(ICommand, KeyGesture)

使用指定的 KeyBindingICommand,初始化 KeyGesture 類別的新執行個體。

C#
public KeyBinding(System.Windows.Input.ICommand command, System.Windows.Input.KeyGesture gesture);

參數

command
ICommand

gesture 關聯的命令。

gesture
KeyGesture

command 關聯的組合鍵。

例外狀況

commandgesturenull

另請參閱

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

KeyBinding(ICommand, Key, ModifierKeys)

使用指定的 KeyBinding,和指定的 ICommandKey (將轉換為 ModifierKeys),初始化 KeyGesture 類別的新執行個體。

C#
public KeyBinding(System.Windows.Input.ICommand command, System.Windows.Input.Key key, System.Windows.Input.ModifierKeys modifiers);

參數

command
ICommand

要叫用的命令。

key
Key

command 關聯的按鍵。

modifiers
ModifierKeys

command 關聯的輔助按鍵。

另請參閱

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10