Class Command
- Namespace
- CarinaStudio.Windows.Input
- Assembly
- CarinaStudio.AppBase.Application.dll
Implementation of ICommand.
public class Command : BaseCommand, ICommand
- Inheritance
-
Command
- Implements
- Inherited Members
- Extension Methods
Constructors
Command(Action, IObservable<bool>?)
Initialize new Command instance.
public Command(Action execute, IObservable<bool>? canExecute = null)
Parameters
executeActionAction to execute command.
canExecuteIObservable<bool>IObservable<T> to indicate whether command can be executed or not.
Command(Func<Task>, IObservable<bool>?)
Initialize new Command instance.
public Command(Func<Task> asyncExecute, IObservable<bool>? canExecute = null)
Parameters
asyncExecuteFunc<Task>Asynchronous action to execute command.
canExecuteIObservable<bool>IObservable<T> to indicate whether command can be executed or not.
Methods
CanExecute(object?)
Check whether command can be executed or not.
public override bool CanExecute(object? parameter)
Parameters
parameterobjectParameter.
Returns
Execute(object?)
Execute command.
public override void Execute(object? parameter)
Parameters
parameterobjectParameter.