Generated by DocFX

Interface IAsyncRelayCommand

An interface expanding IRelayCommand to support asynchronous operations.

Inherited Members
IRelayCommand.NotifyCanExecuteChanged()
Namespace: ISynergy.Framework.Mvvm.Abstractions.Commands
Assembly: ISynergy.Framework.Mvvm.dll
Syntax
public interface IAsyncRelayCommand : IRelayCommand

Properties

View Source

CanBeCanceled

Gets a value indicating whether a running operation for this command can currently be canceled.

Declaration
bool CanBeCanceled { get; }
Property Value
Type Description
System.Boolean
Remarks

The exact sequence of events that types implementing this interface should raise is as follows:

  • The command is initially not running: IsRunning, CanBeCanceled and IsCancellationRequested are false.
  • The command starts running: IsRunning and CanBeCanceled switch to true. IsCancellationRequested is set to false.
  • If the operation is canceled: CanBeCanceled switches to false and IsCancellationRequested switches to true.
  • The operation completes: IsRunning and CanBeCanceled switch to false. The state of IsCancellationRequested is undefined.
This only applies if the underlying logic for the command actually supports cancelation. If that is not the case, then CanBeCanceled and IsCancellationRequested will always remain false regardless of the current state of the command.
View Source

ExecutionTask

Gets the last scheduled , if available. This property notifies a change when the completes.

Declaration
Task? ExecutionTask { get; }
Property Value
Type Description
System.Nullable<Task>
View Source

IsCancellationRequested

Gets a value indicating whether a cancelation request has been issued for the current operation.

Declaration
bool IsCancellationRequested { get; }
Property Value
Type Description
System.Boolean
View Source

IsRunning

Gets a value indicating whether the command currently has a pending operation being executed.

Declaration
bool IsRunning { get; }
Property Value
Type Description
System.Boolean

Methods

View Source

Cancel()

Communicates a request for cancelation.

Declaration
void Cancel()
Remarks

If the underlying command is not running, or if it does not support cancelation, this method will perform no action. Note that even with a successful cancelation, the completion of the current operation might not be immediate.

View Source

ExecuteAsync(Nullable<Object>)

Provides a more specific version of , also returning the representing the async operation being executed.

Declaration
Task ExecuteAsync(object? parameter)
Parameters
Type Name Description
System.Nullable<System.Object> parameter

The input parameter.

Returns
Type Description
Task

The representing the async operation being executed.

Extension Methods

IAsyncRelayCommandExtensions.CreateCancelCommand(IAsyncRelayCommand)
Matrix.Replace<T>(T, Object, Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
EntityBaseExtensions.HasProperty(Object, String)
ArrayExtensions.Concatenate<T>(T, T[])
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>, Func<TSource, Boolean>)
CollectionExtensions.FromHierarchy<TSource>(TSource, Func<TSource, TSource>)
ObjectExtensions.Clone<T>(T)
ObjectExtensions.To<T>(Object)
ObjectExtensions.To(Object, Type)
ObjectExtensions.HasMethod(Object, String)
ObjectExtensions.AddressOf<T>(T)
ReflectionExtensions.GetIdentityValue<T>(T)
ReflectionExtensions.GetIdentityValue<T, TResult>(T)
ReflectionExtensions.GetIdentityProperty<T>(T)
ReflectionExtensions.HasIdentityProperty<T>(T)
ReflectionExtensions.GetPropertyValue<T, TResult>(T, String, TResult)
ReflectionExtensions.GetPropertyInfo<T, TValue>(T, Expression<Func<T, TValue>>)
ReflectionExtensions.GetTitleValue<T>(T)
ReflectionExtensions.HasParentIdentityProperty<T>(T)
ReflectionExtensions.GetParentIdentityProperty<T>(T)
ReflectionExtensions.IsFreeApplication<T>(T)