Edit

Share via


AsyncRelayCommand Constructors

Definition

Overloads

AsyncRelayCommand(Func<CancellationToken,Task>)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<Task>)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<CancellationToken,Task>, AsyncRelayCommandOptions)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<CancellationToken,Task>, Func<Boolean>)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<Task>, AsyncRelayCommandOptions)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<Task>, Func<Boolean>)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<CancellationToken,Task>, Func<Boolean>, AsyncRelayCommandOptions)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<Task>, Func<Boolean>, AsyncRelayCommandOptions)

Initializes a new instance of the AsyncRelayCommand class.

AsyncRelayCommand(Func<CancellationToken,Task>)

Source:
AsyncRelayCommand.cs
Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (cancelableExecute As Func(Of CancellationToken, Task))

Parameters

cancelableExecute
Func<CancellationToken,Task>

The cancelable execution logic.

Exceptions

Thrown if cancelableExecute is null.

Applies to

AsyncRelayCommand(Func<Task>)

Source:
AsyncRelayCommand.cs
Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.Tasks.Task> execute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.Tasks.Task> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (execute As Func(Of Task))

Parameters

execute
Func<Task>

The execution logic.

Exceptions

Thrown if execute is null.

Applies to

AsyncRelayCommand(Func<CancellationToken,Task>, AsyncRelayCommandOptions)

Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (cancelableExecute As Func(Of CancellationToken, Task), options As AsyncRelayCommandOptions)

Parameters

cancelableExecute
Func<CancellationToken,Task>

The cancelable execution logic.

options
AsyncRelayCommandOptions

The options to use to configure the async command.

Exceptions

Thrown if cancelableExecute is null.

Applies to

AsyncRelayCommand(Func<CancellationToken,Task>, Func<Boolean>)

Source:
AsyncRelayCommand.cs
Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, Func<bool> canExecute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<bool> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (cancelableExecute As Func(Of CancellationToken, Task), canExecute As Func(Of Boolean))

Parameters

cancelableExecute
Func<CancellationToken,Task>

The cancelable execution logic.

canExecute
Func<Boolean>

The execution status logic.

Exceptions

Thrown if cancelableExecute or canExecute are null.

Applies to

AsyncRelayCommand(Func<Task>, AsyncRelayCommandOptions)

Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.Tasks.Task> execute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.Tasks.Task> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (execute As Func(Of Task), options As AsyncRelayCommandOptions)

Parameters

execute
Func<Task>

The execution logic.

options
AsyncRelayCommandOptions

The options to use to configure the async command.

Exceptions

Thrown if execute is null.

Applies to

AsyncRelayCommand(Func<Task>, Func<Boolean>)

Source:
AsyncRelayCommand.cs
Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.Tasks.Task> execute, Func<bool> canExecute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.Tasks.Task> * Func<bool> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (execute As Func(Of Task), canExecute As Func(Of Boolean))

Parameters

execute
Func<Task>

The execution logic.

canExecute
Func<Boolean>

The execution status logic.

Exceptions

Thrown if execute or canExecute are null.

Applies to

AsyncRelayCommand(Func<CancellationToken,Task>, Func<Boolean>, AsyncRelayCommandOptions)

Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, Func<bool> canExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task> * Func<bool> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (cancelableExecute As Func(Of CancellationToken, Task), canExecute As Func(Of Boolean), options As AsyncRelayCommandOptions)

Parameters

cancelableExecute
Func<CancellationToken,Task>

The cancelable execution logic.

canExecute
Func<Boolean>

The execution status logic.

options
AsyncRelayCommandOptions

The options to use to configure the async command.

Exceptions

Thrown if cancelableExecute or canExecute are null.

Applies to

AsyncRelayCommand(Func<Task>, Func<Boolean>, AsyncRelayCommandOptions)

Source:
AsyncRelayCommand.cs

Initializes a new instance of the AsyncRelayCommand class.

public AsyncRelayCommand(Func<System.Threading.Tasks.Task> execute, Func<bool> canExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand : Func<System.Threading.Tasks.Task> * Func<bool> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand
Public Sub New (execute As Func(Of Task), canExecute As Func(Of Boolean), options As AsyncRelayCommandOptions)

Parameters

execute
Func<Task>

The execution logic.

canExecute
Func<Boolean>

The execution status logic.

options
AsyncRelayCommandOptions

The options to use to configure the async command.

Exceptions

Thrown if execute or canExecute are null.

Applies to