/// <summary> /// Creates the new account from the information in the form. /// </summary> public void CreateAccount(object passwordEntry) { // Create the account of the appropriate manual/automatic type Account newAccount; if (CanCreateManualAccount()) newAccount = CreateManualAccount(); else if (CanCreateAutomaticAccount(passwordEntry)) // Create the automatic account newAccount = CreateAutomaticAccount(passwordEntry); else return; // Unreachable var locator = new ViewModelLocator(); // Update accounts on accounts view locator.Accounts.UpdateAccounts(); // Navigate to empty tab locator.Accounts.SelectedTabSource = null; // Transition back to accounts view _modernNavigationService.NavigateTo(nameof(ViewModelLocator.Accounts)); // Do not allow navigation back to add account screen _modernNavigationService.ClearNavigationHistory(); }
/// <summary> /// Cancels action. Returns to previous view. /// </summary> public void Cancel() { // Transition to Accounts View var locator = new ViewModelLocator(); locator.Main.ActiveViewModel = locator.Accounts; }