Esempio n. 1
0
        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;
            }
        }