May 2019
Intermediate to advanced
504 pages
11h 50m
English
Another popular area of implementation for asynchronous tasks are the commands that are exposed through the view models throughout the mobile application. If the business flow that is to be executed as a response to a user input (for example, a submit button executing an update call on the user profile) depends on an asynchronous code block, then the command should be implemented in such a way that you can invoke the asynchronous function properly.
Let's demonstrate this with our existing view model. First, we would need to implement our internal execution method:
public async Task ExecuteUpdateUserProfile() { try { await _usersApi.UpdateUser(CurrentUser); } catch (Exception ex) { // TODO: } }
Now, let's ...
Read now
Unlock full access