예제 #1
0
        /// <summary>
        /// Test WPF for proper loading
        /// </summary>
        public BudgetViewModel()
        {
            budgetViewSource     = new CollectionViewSource();
            InsertExpenseCommand = new RelayCommand(InsertExpense);
            NewExpense           = new ExpenseViewModel();
            List <Expense> test  = new List <Expense>();
            Expense        data  = new Expense("Gas", 4.5f, DateTime.Today);
            Expense        data2 = new Expense("Redbull", 2.5f, DateTime.Today);
            Expense        data3 = new Expense("Dog", 450f, DateTime.Today, "No regrets");

            test.Add(data);
            test.Add(data2);
            test.Add(data3);
            Expenses = test;
        }
예제 #2
0
 /// <summary>
 /// Construct listviewmodel from list of blockinfo
 /// </summary>
 /// <param name="blockInfoList"></param>
 public BudgetViewModel(List <Expense> expenseList)
 {
     budgetViewSource     = new CollectionViewSource();
     InsertExpenseCommand = new RelayCommand(InsertExpense);
     NewExpense           = new ExpenseViewModel();
 }