/// <summary> /// uses calendarRepository for getting the newest list from server /// </summary> public async void ShowAll() { CalendarEntries.Clear(); _fullEntrieList = (await _calendarRepository.GetCalendarEntriesAsync()).ToList(); CalendarEntries.AddRange(_fullEntrieList); NotifyOfPropertyChange(() => CalendarEntries); }
/// <summary> /// Search for CalendarEntrie within StartTime and EndTime /// </summary> public void Search() { var list = _fullEntrieList.Where(i => i.StartTime >= StartTime && i.EndTime <= EndTime.AddDays(1)); CalendarEntries.Clear(); CalendarEntries.AddRange(list); }
public CalendarViewModel(ICalendarRepository calendarRepository, IWindowManager windowManager) { _calendarRepository = calendarRepository; _windowManager = windowManager; _fullEntrieList = _calendarRepository.GetCalendarEntries().ToList(); CalendarEntries.AddRange(_fullEntrieList); SelectedEntrie = _calendarEntries.FirstOrDefault(); }