private void signupButton_Click(object sender, EventArgs e) { SignUp signupForm = new SignUp(); this.Hide(); signupForm.ShowDialog(); this.Show(); tbxName.Text = ""; tbxPassword.Text = ""; }
private async void Application_Startup(object sender, StartupEventArgs e) { try { await CurrentConnection.CurrentClient.TryConnectToServerAsync("127.0.0.1", 27015); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); Environment.Exit(0); } bool isUserAuthenticated = false; do { var signIn = new SignIn(); signIn.ShowDialog(); switch (signIn.SignInResult) { case SignIn.SignInResults.Success: isUserAuthenticated = true; break; case SignIn.SignInResults.LinkToSignUp: var signUp = new SignUp(); signUp.ShowDialog(); switch (signUp.SignUpResult) { case SignUp.SignUpResults.Success: case SignUp.SignUpResults.LinkToSignIn: continue; } break; } }while (!isUserAuthenticated); var mainWindow = new Main(); mainWindow.ShowDialog(); Environment.Exit(0); }
private void buttonSignUp_Click(object sender, RoutedEventArgs e) { SignUp signUpWindow = new SignUp(connectionService); signUpWindow.ShowDialog(); }