Прочетете на английски Редактиране

Споделяне чрез


KeyBinding Constructors

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Initializes a new instance of the KeyBinding class.

Overloads

KeyBinding()

Initializes a new instance of the KeyBinding class.

KeyBinding(ICommand, KeyGesture)

Initializes a new instance of the KeyBinding class using the specified ICommand and KeyGesture.

KeyBinding(ICommand, Key, ModifierKeys)

Initializes a new instance of the KeyBinding class using the specified ICommand and the specified Key and ModifierKeys which will be converted into a KeyGesture.

KeyBinding()

Initializes a new instance of the KeyBinding class.

C#
public KeyBinding();

See also

Applies to

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

Initializes a new instance of the KeyBinding class using the specified ICommand and KeyGesture.

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

Parameters

command
ICommand

The command to associate with gesture.

gesture
KeyGesture

The key combination to associate with command.

Exceptions

command or gesture is null.

See also

Applies to

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

Initializes a new instance of the KeyBinding class using the specified ICommand and the specified Key and ModifierKeys which will be converted into a KeyGesture.

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

Parameters

command
ICommand

The command to invoke.

key
Key

The key to be associated with command.

modifiers
ModifierKeys

The modifiers to be associated with command.

See also

Applies to

.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