An asynchronous implementation of ICommand that uses delegates for the execute and can-execute logic,
without accepting a command parameter. This class is typically generated by the CommandAttribute aspect
for methods returning Task or when Background is true.
Namespace: Metalama.Patterns.Wpf
Assembly: Metalama.Patterns.Wpf.dll
Syntax
public sealed class AsyncDelegateCommand : BaseAsyncDelegateCommand, IAsyncCommand, ICommand, INotifyPropertyChangedRemarks
This class implements IAsyncCommand and INotifyPropertyChanged, exposing properties like IsRunning, CanCancel, and ExecutionTask to monitor command execution state.
By default, the command cannot be executed concurrently. This can be changed via SupportsConcurrentExecution.
Properties
| Name | Description |
|---|---|
| CanExecute | Gets a value indicating whether the command can be executed.
Returns |
Methods
| Name | Description |
|---|---|
| Execute() | Executes the command asynchronously and returns a DelegateCommandExecution that can be used to track and cancel the execution. |