public RoomSearchViewModel(IDataService dataService, ProgressViewModel progressViewModel) { _dataService = dataService; _progressViewModel = progressViewModel; SearchCommand = new RelayCommand(PerformSearch, () => SelectedRooms != null && SelectedRooms.Count > 0); ResetData(); SelectedDate = DateTime.Today; SelectedStartTime = DateTime.Now; var today = Today; if (DateTime.Now > today.AddHours(16)) { SelectedEndTime = DateTime.Now.AddHours(1); } else if (DateTime.Now >= today.AddHours(12)) { SelectedEndTime = today.AddHours(16); } else { SelectedEndTime = today.AddHours(12); } SelectedExtras = RoomExtras.None; _progressViewModel.DataReloaded += OnDataReloaded; }
public MainViewModel(IDataService dataService, ProgressViewModel progressViewModel) { _dataService = dataService; _progressViewModel = progressViewModel; ReloadCoursesCommand = new RelayCommand(ReloadCourses); UpdateUrlCommand = new RelayCommand(RequestNewCalendarUrl); }