public WeeklyGoalsWindowViewModel(DateTime date, IGoalTrackerService gtService) { FirstDayOfWeek = FirstDayOfWeek(date); LastDayOfWeek = LastDayOfWeek(date); CreateWeeklyGoalsList(gtService.GetWeekForDate(date)); CloseCommand = new DelegateCommand(() => RequestClose?.Invoke()); }
public DailyGoalsWindowViewModel(DateTime date, IGoalTrackerService gtService) { this.gtService = gtService; Day day = gtService.GetDayForDate(date); Week week = gtService.GetWeekForDate(date); Date = date; CanCreateDay = day == null && gtService.DailyGoals.Count > 0; TrackDailyGoalsCommand = new DelegateCommand(TrackDailyGoals, () => CanCreateDay); CloseCommand = new DelegateCommand(() => RequestClose?.Invoke()); CreateDailyGoalsList(day); CreateWeeklyGoalsList(week); }