Table of Contents

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

execute Action

Action to execute command.

canExecute IObservable<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

asyncExecute Func<Task>

Asynchronous action to execute command.

canExecute IObservable<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

parameter object

Parameter.

Returns

bool

Execute(object?)

Execute command.

public override void Execute(object? parameter)

Parameters

parameter object

Parameter.