private void Button_Click(object sender, RoutedEventArgs e) { bool con = false; if (comboBox.SelectedItem.ToString() == "Savings account") { BankLogic.AddSavingsAccount(MainPage.ChoosenCustomer, AccountNumber.Text); con = true; } else if (comboBox.SelectedItem.ToString() == "Credit account") { BankLogic.AddCreditAccount(AccountNumber.Text, MainPage.ChoosenCustomer); con = true; } else if (comboBox.SelectedItem.ToString() == "") { con = false; } if (con == true) { var _Frame = Window.Current.Content as Frame; _Frame.Navigate(typeof(MainPage)); } }