Interface IAsyncRelayCommand
An interface expanding IRelay
Inherited Members
Namespace: Unity.AppUI.MVVM
Assembly: Unity.AppUI.MVVM.dll
Syntax
public interface IAsyncRelayCommand : IRelayCommand, ICommand, INotifyPropertyChanged
Properties
canBeCancelled
Gets a value indicating whether a running operation for this command can currently be canceled.
Declaration
bool canBeCancelled { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
The exact sequence of events that types implementing this interface should raise is as follows:
-
The command is initially not running: is
Running , canBe and isCancelled Cancellation are false.Requested -
The command starts running: is
Running and canBe switch to true. isCancelled Cancellation is set to false.Requested -
If the operation is canceled: can
Be switches to false and isCancelled Cancellation switches to true.Requested -
The operation completes: is
Running and canBe switch to false. The state of isCancelled Cancellation is undefined.Requested
executionTask
Gets the last scheduled Task, if available. This property notifies a change when the Task completes.
Declaration
Task? executionTask { get; }
Property Value
Type | Description |
---|---|
Task |
isCancellationRequested
Gets a value indicating whether a running operation for this command has been cancelled.
Declaration
bool isCancellationRequested { get; }
Property Value
Type | Description |
---|---|
bool |
isRunning
Gets a value indicating whether an operation for this command is currently running.
Declaration
bool isRunning { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
Cancel()
Attempts to cancel the currently running operation for this command.
Declaration
void Cancel()
ExecuteAsync(object?)
Executes the command asynchronously.
Declaration
Task ExecuteAsync(object? parameter)
Parameters
Type | Name | Description |
---|---|---|
object | parameter | The input parameter. |