Table of Contents

Class Command<TParam>

Namespace
CarinaStudio.Windows.Input
Assembly
CarinaStudio.AppBase.Application.dll

Implementation of ICommand.

public class Command<TParam> : BaseCommand, ICommand

Type Parameters

TParam
Inheritance
Command<TParam>
Implements
Inherited Members
Extension Methods

Constructors

Command(Action<TParam>, IObservable<bool>?)

Initialize new Command instance.

public Command(Action<TParam> execute, IObservable<bool>? canExecute = null)

Parameters

execute Action<TParam>

Action to execute command.

canExecute IObservable<bool>

IObservable<T> to indicate whether command can be executed or not.

Command(Func<TParam, Task>, IObservable<bool>?)

Initialize new Command instance.

public Command(Func<TParam, Task> asyncExecute, IObservable<bool>? canExecute = null)

Parameters

asyncExecute Func<TParam, 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.