public MyGoalViewModel(ISqlite sqlite, IDialogService dialog) { this.dialog = dialog; SelectedGoals = new ObservableCollection <SelectedGoal>() { }; this.selectedGoalDatabase = new SelectedGoalDatabase(sqlite); this.goalDatabase = new GoalDatabase(sqlite); loadSelectedGoalsFromDbToday(); ViewSelectedGoalCommand = new MvxCommand <SelectedGoal>(selectedSelectedGoal => { ShowViewModel <GoalUpdateViewModel>(new { selectedGoalId = selectedSelectedGoal.Id }); } ); }
public GoalListViewModel(ISqlite sqlite, IDialogService dialog) { this.dialog = dialog; Goals = new ObservableCollection <Goal>() { }; this.goalDatabase = new GoalDatabase(sqlite); this.selectedGoalDatabase = new SelectedGoalDatabase(sqlite); // only do this for one time, it will clear existing database. beware, may clear dependencies insertSampleGoalsToDbIfNotExist(); loadGoalsFromDb(); SelectGoalCommand = new MvxCommand <Goal>(selectedGoal => { ShowViewModel <GoalDetailViewModel>(selectedGoal); } ); }
public GoalDiaryViewModel(ISqlite sqlite, IDialogService dialog) { this.dialog = dialog; SelectedGoals = new ObservableCollection <SelectedGoal>() { }; this.selectedGoalDatabase = new SelectedGoalDatabase(sqlite); this.goalDatabase = new GoalDatabase(sqlite); // only do this if doesn exist. will clear existing selected goals. loadSelectedGoalsFromDb(); ViewSelectedGoalCommand = new MvxCommand <SelectedGoal>(selectedSelectedGoal => { ShowViewModel <GoalUpdateViewModel>(new { selectedGoalId = selectedSelectedGoal.Id }); } ); }
public GoalDetailViewModel(ISqlite sqlite, IDialogService dialog) { //Debug.WriteLine("############### initialize sqlite"); this.selectedGoalDatabase = new SelectedGoalDatabase(sqlite); }
public GoalUpdateViewModel(ISqlite sqlite) { this.selectedGoalDatabase = new SelectedGoalDatabase(sqlite); this.goalDatabase = new GoalDatabase(sqlite); }