Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IAsyncRelayCommand Interface

Definition

Namespace:
CommunityToolkit.Mvvm.Input
Assembly:
CommunityToolkit.Mvvm.dll
Package:
CommunityToolkit.Mvvm v8.4.0
Package:
CommunityToolkit.Mvvm v7.0.3
Source:
IAsyncRelayCommand.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

An interface expanding IRelayCommand to support asynchronous operations.

public interface IAsyncRelayCommand : CommunityToolkit.Mvvm.Input.IRelayCommand, System.ComponentModel.INotifyPropertyChanged, System.Windows.Input.ICommand
type IAsyncRelayCommand = interface
 interface IRelayCommand
 interface ICommand
 interface INotifyPropertyChanged
Public Interface IAsyncRelayCommand
Implements ICommand, INotifyPropertyChanged, IRelayCommand
Derived
Implements

Properties

CanBeCanceled

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

ExecutionTask

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

IsCancellationRequested

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

IsRunning

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

Methods

Cancel()

Communicates a request for cancelation.

ExecuteAsync(Object)

Provides a more specific version of Execute(Object), also returning the Task representing the async operation being executed.

NotifyCanExecuteChanged()

Notifies that the CanExecute(Object) property has changed.

(Inherited from IRelayCommand)

Extension Methods

CreateCancelCommand(IAsyncRelayCommand)

Creates an ICommand instance that can be used to cancel execution on the input command. The returned command will also notify when it can be executed based on the state of the wrapped command.

Applies to