public void DeleteWordItem(WordNoteBookViewModel WordNoteBookViewModel) { //删去ViewModel WordNoteBookViewModelCollection.Remove(WordNoteBookViewModel); //删去Model //Model.DeleteHistoryItem(WordNoteBookViewModel); WordListItemsCountNum = WordNoteBookViewModelCollection.Count; }
public void Delete(WordNoteBookViewModel viewmodelitem) { WordNoteBookHelper.DeleteByID(viewmodelitem.ID); WordNoteBookViewModelCollection.Remove(viewmodelitem); foreach (var item in WordNoteBookStackPanel.Children) { if ((int)(((NoteBookControl)item).Tag) == viewmodelitem.ID) { WordNoteBookStackPanel.Children.Remove(item); } } Count(); }