示例#1
0
        public BudgetingPage(FundViewModel fundView, ExpenseViewModel expenseView)
        {
            var expenseStore = new SQLiteExpenseStore(DependencyService.Get <ISQLiteDb>());
            var fundStore    = new SQLiteFundStore(DependencyService.Get <ISQLiteDb>());
            var pageService  = new PageService();

            ViewModel = new BudgetViewModel(pageService, fundView ?? new FundViewModel(), fundStore, expenseView ?? new ExpenseViewModel(), expenseStore);
            InitializeComponent();
        }
示例#2
0
        public AddExpensePage(ExpenseViewModel expenseView)
        {
            Constants.myAdID = "ca-app-pub-6838059012127071/2589200474";
            InitializeComponent();

            var expenseStore = new SQLiteExpenseStore(DependencyService.Get <ISQLiteDb>());
            var pageService  = new PageService();

            Title          = (expenseView.Id == 0) ? "New Expense" : "Edit Expense";
            BindingContext = new ExpenseDetailViewModel(expenseView ?? new ExpenseViewModel(), expenseStore, pageService);
        }