May 2019
Intermediate to advanced
504 pages
11h 50m
English
In an asynchronous UI implementation, it is almost impossible to avoid command declarations and bindings that handle asynchronous tasks. The general approach here would be to create an async delegate and pass it as an action for the command. However, this type of promise-based execution diminishes our capacity to see through the complete life cycle of the asynchronous block. This makes it harder to create unit test for these blocks and avoid scenarios where a terminal event, such as the navigation to a different view or closing the application, can interrupt the execution.
Let's look at UpdateUserCommand, which we implemented previously:
_updateUserCommand = new Command(async () => await ExecuteUpdateUserProfile()); ...
Read now
Unlock full access