The current version of the AsyncCommand rethrows any exception that occurs in the task run by the command.
In the following code
public AsyncCommandsDemoViewModel(IDataClient dataClient)
{
this.CancelGetData = new CancelCommand();
this.GetData = new AsyncCommand(
this.CancelGetData.Wrap(
async cancellationToken =>
this.Data = await dataClient.GetDataAsync(cancellationToken)));
}
If the GetDataAsync throws any exception it will be propagated to the UI thread causing the application to crash.
The current version of the
AsyncCommandrethrows any exception that occurs in the task run by the command.In the following code
If the
GetDataAsyncthrows any exception it will be propagated to the UI thread causing the application to crash.