New to Telerik UI for .NET MAUIStart a free 30-day trial

Provides a base implementation for control-specific commands.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Type Parameters:

T

The type of control this command is associated with.

Syntax:

C#
public abstract class ControlCommandBase<T> : AttachableObject<T>, ICommand where T : class

Inheritance: objectAttachableObject<T>ControlCommandBase<T>

Derived Classes: DataGridCommandSideDrawerCommandBase

Implements: ICommand

Inherited Members AttachableObject<T>.OnDetached(T)AttachableObject<T>.OnAttached()AttachableObject<T>.Owner

Constructors

C#
protected ControlCommandBase()

Methods

Defines the method that determines whether the command can execute in its current state.

C#
public virtual bool CanExecute(object parameter)
Parameters:parameterobject

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Returns:

bool

true if this command can be executed; otherwise, false.

Implements: ICommand.CanExecute(object)

Defines the method to be called when the command is invoked.

C#
public virtual void Execute(object parameter)
Parameters:parameterobject

Data used by the command. If the command does not require data to be passed, this object can be set to null.

Implements: ICommand.Execute(object)

Raises the CanExecuteChanged event.

C#
protected virtual void OnCanExecuteChanged(EventArgs e)
Parameters:eEventArgs

The event arguments.

Events

Occurs when changes occur that affect whether or not the command should execute.

C#
public event EventHandler CanExecuteChanged

Implements: ICommand.CanExecuteChanged