AsyncCommand
Ecng.ComponentModel
Async delegate command without argument.
Inherits: AsyncCommand<object>
Constructors
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.
Methods
ExecuteAsync
public Task ExecuteAsync()
result = asyncCommand.ExecuteAsync()
Executes the command asynchronously.
Returns: A task representing the async operation.