void descriptionCollection_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: foreach (description desc in e.NewItems) { Entities.description.AddObject(desc); } break; case NotifyCollectionChangedAction.Remove: foreach (description desc in e.OldItems) { Entities.description.DeleteObject(desc); } break; } ChangesSavedSuccessfully = false; try { Entities.SaveChanges(); ChangesSavedSuccessfully = true; } catch (Exception ex) { MessageBox.Show(ex.ToString()); } queryResultsCollection.ReplaceRange(queryResults); }