Click or drag to resize

AsyncRelayCommandExecute Method

Executes the ICommand on the current command target.

Namespace:  BionicCode.Utilities.Net.Framework.Wpf
Assembly:  BionicCode.Utilities.Net.Framework.Wpf (in BionicCode.Utilities.Net.Framework.Wpf.dll) Version: 1.0.1.0 (1.0.0.0)
Syntax
public void Execute()

Implements

IAsyncRelayCommandExecute
Remarks
When this method is called although an asynchronous execute delegate was registered, this asynchronous delegate will be executed asynchronously, but since the Execute 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 instead.

See Also
https://github.com/BionicCode/BionicCode.Net/blob/master/README.md