Esempio n. 1
0
        public async Task RefreshStories(bool isLoadingMore)
        {
            HotCircleStories hotCircleStories = null;

            if (isLoadingMore)
            {
                if (StoryDataList.Count > 0)
                {
                    hotCircleStories = await DataRequester.RequestNextStoriesForCircle(CircleId, StoryDataList.Last().Time.ToString());
                }
            }
            else
            {
                ResetStorys();
                hotCircleStories = await DataRequester.RequestLatestStoriesForCircle(CircleId);

                if (hotCircleStories != null && hotCircleStories.Stories != null && hotCircleStories.Stories.Count > 0)
                {
                    CurrentStoryId = hotCircleStories.Stories.First().Id.ToString();
                }
            }

            if (hotCircleStories == null || hotCircleStories.Stories == null || hotCircleStories.Stories.Count == 0)
            {
                return;
            }

            hotCircleStories.Stories.ForEach(story => story.AdjustForHotCircleStory(Circle));
            StoryDataList.AddRange(hotCircleStories.Stories);
        }