async protected override Task <IList <object> > LoadMoreItemsOverrideAsync(System.Threading.CancellationToken c, uint count)
        {
            ++loadIndex;
            var pg = await PhotosDataSource.Search(tags[loadIndex], random.Next(5, 15));

            return(new List <object> {
                pg
            });
        }
        async void Init()
        {
            progress.Visibility = Visibility.Visible;
            var pgs = await PhotosDataSource.LoadPhotos(8);

            progress.Visibility = Visibility.Collapsed;

            foreach (var pg in pgs)
            {
                photos.Add(pg);
            }

            photosSource.Source = photos;

            var scrollViewer = gridPhotos.GetFirstDescendantOfType <ScrollViewer>();

            scrollViewer.ViewChanging += scrollViewer_ViewChanging;
        }
        async void scrollViewer_ViewChanging(object sender, ScrollViewerViewChangingEventArgs e)
        {
            ScrollViewer sv = sender as ScrollViewer;

            // if the difference between horizontal offset and scrollable width is less than
            // INCREMENTAL_LOAD_OFFSET_TRIGGER pixels load next group
            if (((sv.ScrollableWidth - e.FinalView.HorizontalOffset) < INCREMENTAL_LOAD_OFFSET_TRIGGER) &&
                (PhotosDataSource.IsBusy == false) &&
                (PhotosDataSource.HasMoreItems))
            {
                progress.Visibility = Visibility.Visible;
                var newPhotos = await PhotosDataSource.LoadPhotos(1);

                progress.Visibility = Visibility.Collapsed;

                foreach (var pg in newPhotos)
                {
                    photos.Add(pg);
                }
            }
        }