private async Task LoadDataAsync() { try { // we need to ask for credentials var loginVm = new LoginVm(); if (interactionService.ShowInDialog(loginVm) == true) { // performing login var userId = await dataService.LoginAsync(loginVm.UserName, loginVm.Password); // setting content to general view model, which is the payload of our app Content = new GeneralVm(userId, dataService); } else { // setting content to stub, which shows us "Login cancelled" message Content = new StubVm { Message = "Login cancelled" }; } } catch (Exception ex) { // setting content to stub, which shows us "Login failed" message Content = new StubVm { Message = $"Login failed: {ex.Message}" }; } }