private void Button_Click(object sender, RoutedEventArgs e) { MainPage.ChoosenCustomer = BankLogic.AddCustomer(NameText.Text, SsnText.Text); textBlock.Visibility = Visibility.Visible; var _Frame = Window.Current.Content as Frame; _Frame.Navigate(typeof(MainPage)); }