void ExecuteLoadHistoryItemsCommand() { if (IsBusy) { return; } IsBusy = true; try { Expenses = expenseViewModel.GetAllExpenses().ToList(); Incomes = incomeViewModel.GetAllIncomes().ToList(); HistoryItems.Clear(); HistoryItems.AddRange(Expenses); HistoryItems.AddRange(Incomes); HistoryItems = HistoryItems.OrderByDescending(x => x.Date).ToList(); ItemsGrouped = GroupItems(); } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } }
public void Dispose() { try { HistoryItems.Clear(batch: false, force: true); Contents = null; } catch (Exception ex) { ex.ERROR("DisposeHistory"); } }
private void ShowHistory(bool overwrite = false) { try { HistoryItems.Wait(); var setting = Application.Current.LoadSetting(); if (HistoryItems.ItemsCount <= 0 || Keyboard.Modifiers == ModifierKeys.Control) { HistoryItems.Clear(setting.BatchClearThumbnails); this.DoEvents(); HistoryItems.Items.AddRange(Application.Current.HistorySource()); this.DoEvents(); } else { UpdateLikeState(); this.DoEvents(); UpdateDownloadState(); this.DoEvents(); } HistoryItems.UpdateTilesImage(overwrite); } catch (Exception ex) { HistoryItems.Fail(); if (ex is NullReferenceException) { //"No Result".ShowMessageBox("WARNING"); "No Result".ShowToast("WARNING", tag: "ShowHistory"); } else { ex.Message.ShowMessageBox("ERROR[HISTORY]"); } } finally { HistoryItems.Ready(); this.DoEvents(); } }
public void ClearItems() { HistoryItems.Clear(); }