AsyncCommand

Ecng.ComponentModel

Async delegate command without argument.

継承元: AsyncCommand<object>

コンストラクター

AsyncCommand
public AsyncCommand(Func<CancellationToken, Task> execute, Func<bool> canExecute, bool allowMultipleExecution)
asyncCommand = AsyncCommand(execute, canExecute, allowMultipleExecution)

Creates a new async command.

execute
The async execution logic.
canExecute
The execution status logic.
allowMultipleExecution
Allow multiple concurrent executions.
AsyncCommand
public AsyncCommand(Func<Task> execute, Func<bool> canExecute, bool allowMultipleExecution)
asyncCommand = AsyncCommand(execute, canExecute, allowMultipleExecution)

Creates a new async command without cancellation support.

execute
The async execution logic.
canExecute
The execution status logic.
allowMultipleExecution
Allow multiple concurrent executions.

メソッド

ExecuteAsync
public Task ExecuteAsync()
result = asyncCommand.ExecuteAsync()

Executes the command asynchronously.

戻り値: A task representing the async operation.