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(); }
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); }