public IEnumerable <UnsplashImage> GetImages(int page, int count) { var list = new List <UnsplashImage>(); var start = DateTime.Now.AddDays(-(page - 1) * count); for (var i = 0; i < count; i++) { var next = start.AddDays(-i); if (next < END_TIME) { break; } list.Add(UnsplashImageFactory.CreateHighlightImage(next, true)); } return(list); }
public async override Task <IEnumerable <UnsplashImage> > GetImagesAsync() { var list = new ObservableCollection <UnsplashImage>(); var start = DateTime.Now.AddDays(-(Page - 1) * COUNT); for (var i = 0; i < COUNT; i++) { var next = start.AddDays(-i); if (next < END_TIME) { break; } list.Add(UnsplashImageFactory.CreateHighlightImage(next, true)); } return(await Task.FromResult(list)); }