![](../icons/logo.ico) | AsyncRelayCommandTParamExecute Method (TParam) |
Executes the AsyncRelayCommand on the current command target.
Namespace:
BionicCode.Utilities.Net.Core.Wpf.Generic
Assembly:
BionicCode.Utilities.Net.Core.Wpf (in BionicCode.Utilities.Net.Core.Wpf.dll) Version: 1.0.2
Syntaxpublic void Execute(
TParam parameter
)
Public Sub Execute (
parameter As TParam
)
Dim instance As AsyncRelayCommand
Dim parameter As TParam
instance.Execute(parameter)
public:
virtual void Execute(
TParam parameter
) sealed
abstract Execute :
parameter : 'TParam -> unit
override Execute :
parameter : 'TParam -> unit
public final void Execute(
TParam parameter
)
public final function Execute(
parameter : TParam
)
function Execute(parameter);
METHOD Execute(
parameter AS TParam
) AS VOID
Parameters
- parameter
- Type: TParam
The command parameter.
Implements
IAsyncRelayCommandTParamExecute(TParam)
Remarks When this method is called although an asynchronous execute delegate was registered, this asynchronous delegate will be executed asynchronously, but since the
Execute(TParam) does not return a
Task and is declared as
async void, the execution is not awaitable and more important exceptions from an
async void method can’t be caught with
catch!
Async void methods have different error-handling semantics. When an exception is thrown out of an
async Task or
async Task<T> method, that exception is captured and placed on the
Task object. With
async void methods, there is no Task object, so any exceptions thrown out of an
async void method will be raised directly on the SynchronizationContext that was active when the async void method started. Exceptions thrown from
async void methods can’t be caught naturally.
In such a scenario it is highly recommended to always call
ExecuteAsync(TParam) instead.
See Also