//Pop up the add new user dialog private void btnAdd_Click(object sender, RoutedEventArgs e) { EditCurrentUser.EditMode = false; var addUser = new EditCurrentUser(); addUser.ShowDialog(); //Refresh after possible changes from user Refresh(); }
//Editing the users - using the same dialog window as for add new private void btnEdit_Click(object sender, RoutedEventArgs e) { if (!IsCurrentUser()) { EditCurrentUser.EditMode = true; EditCurrentUser.UserToAddOrEdit = (User)dataUsers.SelectedItem; var editUser = new EditCurrentUser(); editUser.ShowDialog(); Refresh(); } }