private void UpdatePages(IEnumerable <ComicPageData> newPages)
        {
            if (newPages == null || !newPages.Any())
            {
                // Use history if no actual pages exist
                newPages = Comic.RecentHistory
                           .Select(
                    historyItem => new ComicPageData
                {
                    Comic  = Comic,
                    Name   = historyItem,
                    Url    = historyItem,
                    IsRead = true
                });
            }

            var reversed = newPages
                           .Reverse()
                           .ToList();

            // Need to use ObservableCollection methods so UI is updated with animation
            Pages.MatchList(reversed);

            PagesUpdated?.Invoke();

            // Clear ScrollTo target since page shuld have been scrolled during PagesUpdated event (if desired)
            scrollToPageTarget = ComicPageTargetType.None;
        }
Example #2
0
 internal virtual void OnPagesUpdated(WikiPagesUpdateEventArgs e)
 {
     PagesUpdated?.Invoke(this, e);
 }