AsyncCommand
Ecng.ComponentModel
Async delegate command without argument.
Herda de: AsyncCommand<object>
Construtores
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.
Métodos
ExecuteAsync
public Task ExecuteAsync()
result = asyncCommand.ExecuteAsync()
Executes the command asynchronously.
Retorna: A task representing the async operation.