CommandBinding Constructors

Definition

Initializes a new instance of the CommandBinding class.

Overloads

CommandBinding()

Initializes a new instance of the CommandBinding class.

CommandBinding(ICommand)

Initializes a new instance of the CommandBinding class by using the specified ICommand.

CommandBinding(ICommand, ExecutedRoutedEventHandler)

Initializes a new instance of the CommandBinding class by using the specified ICommand and the specified Executed event handler.

CommandBinding(ICommand, ExecutedRoutedEventHandler, CanExecuteRoutedEventHandler)

Initializes a new instance of the CommandBinding class by using the specified ICommand and the specified Executed and CanExecute event handlers.

CommandBinding()

Initializes a new instance of the CommandBinding class.

C#
public CommandBinding();

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

CommandBinding(ICommand)

Initializes a new instance of the CommandBinding class by using the specified ICommand.

C#
public CommandBinding(System.Windows.Input.ICommand command);

Parameters

command
ICommand

The command to base the new RoutedCommand on.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

CommandBinding(ICommand, ExecutedRoutedEventHandler)

Initializes a new instance of the CommandBinding class by using the specified ICommand and the specified Executed event handler.

C#
public CommandBinding(System.Windows.Input.ICommand command, System.Windows.Input.ExecutedRoutedEventHandler executed);

Parameters

command
ICommand

The command to base the new RoutedCommand on.

executed
ExecutedRoutedEventHandler

The handler for the Executed event on the new RoutedCommand.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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

CommandBinding(ICommand, ExecutedRoutedEventHandler, CanExecuteRoutedEventHandler)

Initializes a new instance of the CommandBinding class by using the specified ICommand and the specified Executed and CanExecute event handlers.

C#
public CommandBinding(System.Windows.Input.ICommand command, System.Windows.Input.ExecutedRoutedEventHandler executed, System.Windows.Input.CanExecuteRoutedEventHandler canExecute);

Parameters

command
ICommand

The command to base the new RoutedCommand on.

executed
ExecutedRoutedEventHandler

The handler for the Executed event on the new RoutedCommand.

canExecute
CanExecuteRoutedEventHandler

The handler for the CanExecute event on the new RoutedCommand.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.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