AsyncRelayCommand Constructors
Definition
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.
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
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.
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
- 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
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.
- 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
- options
- AsyncRelayCommandOptions
The options to use to configure the async command.
Exceptions
Thrown if execute
or canExecute
are null
.