AsyncCommand
Ecng.ComponentModel
Async delegate command without argument.
Hereda de: AsyncCommand<object>
Constructores
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.
Devuelve: A task representing the async operation.