예제 #1
0
        private BlogPost GetFeatureItem()
        {
            var featureItem = RecentItems.FirstOrDefault(p => !string.IsNullOrWhiteSpace(p.Image));

            if (featureItem == null)
            {
                featureItem = RecentItems[0];
            }

            return(featureItem);
        }
예제 #2
0
        private async Task LoadRecentItems()
        {
            var response = await _cacheService.GetRecentItemsFromCache();

            if (RecentItems.IsNullOrEmpty())
            {
                RecentItems = new ObservableCollection <ReaderItem>(response.ReaderItems);
                return;
            }

            foreach (var item in response.ReaderItems)
            {
                var existingItem = RecentItems.FirstOrDefault(x => x.Id == item.Id);
                if (existingItem != null)
                {
                    item.CopyItem(existingItem);
                }
                else
                {
                    RecentItems.Add(item);
                }
            }
        }
예제 #3
0
 private BlogPost GetFeatureItem()
 {
     return(RecentItems.FirstOrDefault(p => !string.IsNullOrWhiteSpace(p.Image)));
 }