private void Register_Click(object sender, RoutedEventArgs e) { try { string username = this.LoginBox.Text; string password = this.PasswordBox.Password; Registrator.RegisterUser(username, password); MessageBox.Show("Registered Successfuly!", "Success"); } catch (Exception exception) { MessageBox.Show(exception.Message, "Exception"); } }