public void DeleteWordItem(int ID) { WordHistoryHelper.DeleteByID(ID); foreach (var item in WordHistoryCollection) { if (item.ID == ID) { WordHistoryCollection.Remove(item); return; } } }
public void Add_WordHistory(WordHistoryModel model) { if (WordHistoryHelper.IsQueryHistoryAllowed & !IsDuplicated(model.Word)) { int maxLength = (int)LeptonTextBlockControl.MaxLengthProperty.GetMetadata(typeof(LeptonTextBlockControl)).DefaultValue; if (model.Word.Length > maxLength) { model.Word = model.Word.Substring(0, maxLength); } WordHistoryCollection.Insert(0, WordHistoryHelper.Add(model)); } }
public void DeleteAllHistory() { WordHistoryHelper.DeleteAll(); SearchSuggestionPageViewModel.Current.DeleteAllHistoryItem(); }
public void GetAll_WordHistory() { WordHistoryCollection.Clear(); foreach (var item in ObservableCollectionHelper.GetObservableCollectionFromList(WordHistoryHelper.QueryAll())) { WordHistoryCollection.Add(item); } }