private void BtnEdit_Click(object sender, RoutedEventArgs e) { User selectedUser = DGUser.SelectedItem as User; if (SelectedUser(selectedUser)) { User oldUser = selectedUser.Clone() as User; UserEditWindow uew = new UserEditWindow(selectedUser, UserEditWindow.Option.EDIT); if (uew.ShowDialog() != true) { int index = IndexOfSelectedUser(selectedUser.Username); Data.Instance.Users[index] = oldUser; } else { selectedUser.ChangeUsers(); } } }
private void BtnAdd_Click(object sender, RoutedEventArgs e) { UserEditWindow uew = new UserEditWindow(new User(), UserEditWindow.Option.ADDING); uew.ShowDialog(); }