private void btnCreateUser_Click(object sender, RoutedEventArgs e) { string userName = this.userNameBox.Text; string password = this.passwordBox.Password; string name = this.nameBox.Text; bool isAdmin = (bool)this.isAdminCheck.IsChecked; UserSyncer userSyncer = new UserSyncer(); User user = userSyncer.WebCreateUser(userName, password, name, isAdmin); if (user != null) { UserPrefs.AddUser(user); this.Close(); } else { MessageBox.Show("User already exists!"); } }