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.