public void Save() { foreach (var removed in removedDocumentLists) { Debug.Assert(removed.IsExistingList); if (!removed.IsExistingList) { continue; } bool b = documentListService.SelectedDocumentList == removed.DocumentList; if (b) { continue; } documentListService.Remove(removed.DocumentList); } foreach (var added in addedDocumentLists) { if (removedDocumentLists.Contains(added)) { continue; } documentListService.Add(added.DocumentList); } }