public void GetAll() { WordNoteViewModelCollection.Clear(); foreach (var item in WordNoteHelper.QueryByNoteBookID(ID)) { WordNoteViewModelCollection.Add(new WordNoteViewModel(item)); } WordListItemsCountNum = WordNoteViewModelCollection.Count; }
private void DeleteSelectedItem_Click(object sender, RoutedEventArgs e) { var selecteditems = WordListView.SelectedItems.ToList(); foreach (var item in selecteditems) { var _item = item as WordNoteViewModel; if (WordNoteHelper.Delete(_item.ID)) { ViewModel.WordNoteViewModelCollection.Remove(_item); } } CancelMultiSelectionState(); }
public void GetWordNoteInfo() { WordNoteBookViewModelCollection.Clear(); foreach (var item in WordNoteBookHelper.All()) { var viewmodel = new WordNoteBookViewModel(item); //viewmodel.IsSaved = WordNoteHelper.IsWordSaved(Word); WordNoteBookViewModelCollection.Add(viewmodel); } foreach (var item in WordNoteBookViewModelCollection) { item.IsSaved = WordNoteHelper.IsWordSaved(Word, item.ID); } }
public void Delete(WordNoteViewModel viewmodelitem) { WordNoteHelper.Delete(viewmodelitem.ID); WordNoteViewModelCollection.Remove(viewmodelitem); }
public void DeleteFromBook(string _word, int _wordnotebookid) { WordNoteHelper.Delete(_word, _wordnotebookid); Update(_wordnotebookid); }
public void DeleteFromBook(string _word, int _wordnotebookid) { WordNoteHelper.Delete(_word, _wordnotebookid); NoteBookControlViewModel.Update(_wordnotebookid); }
public void AddToNoteBook(string _word, int _wordnotebookid, string sourcelanguage, string targetlanguage) { WordNoteHelper.Add(_word, _wordnotebookid, sourcelanguage, targetlanguage); NoteBookControlViewModel.Update(_wordnotebookid); }