New to Telerik UI for WinForms? Start a free 30-day trial

Associates an ICommand with execution and availability callbacks.

The internal callback methods invoke their corresponding events directly; calling them without a subscriber throws NullReferenceException.

Definition

Namespace:Telerik.WinControls.UI.Utilities.PlatformSpecific

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
public class CommandBinding

Inheritance: objectCommandBinding

Constructors

Initializes an empty binding; set Command before using it.

C#
public CommandBinding()

Initializes a binding for the specified command and subscribes execution and availability callbacks.

C#
public CommandBinding(ICommand command, ExecutedRoutedEventHandler executed, CanExecuteRoutedEventHandler canExecute)
Parameters:commandICommand

The command to associate with the binding.

executedExecutedRoutedEventHandler

The callback to subscribe to Executed.

canExecuteCanExecuteRoutedEventHandler

The callback to subscribe to CanExecute.

Exceptions: ArgumentNullException

command is null.

Initializes a binding for the specified command and subscribes an execution callback.

C#
public CommandBinding(ICommand command, ExecutedRoutedEventHandler executed)
Parameters:commandICommand

The command to associate with the binding.

executedExecutedRoutedEventHandler

The callback to subscribe to Executed.

Exceptions: ArgumentNullException

command is null.

Initializes a binding for the specified command.

C#
public CommandBinding(ICommand command)
Parameters:commandICommand

The command to associate with the binding.

Exceptions: ArgumentNullException

command is null.

Properties

Gets or sets the command associated with this binding.

C#
public ICommand Command { get; set; }
Exceptions: ArgumentNullException

The assigned command is null.

Events

Occurs when the command associated with this CommandBinding is checked for availability on the command target.

C#
public event CanExecuteRoutedEventHandler CanExecute

Occurs when the command associated with this CommandBinding executes.

C#
public event ExecutedRoutedEventHandler Executed