/// <summary> /// Removes all selected items. /// </summary> private void RemoveSelected() { var datasets = Datasets.Where(dataset => dataset.IsSelected).ToList(); foreach (var dataset in datasets) { Datasets.Remove(dataset); Analysis.MetaData.Datasets.Remove(dataset.Dataset); } var id = 0; foreach (var info in Datasets) { info.DatasetId = id++; } OnPropertyChanged("SelectedCount"); }