Ejemplo n.º 1
0
        private async Task RequestMinorCategoryData(bool isLoadingMore)
        {
            MinorData storyData = null;

            if (isLoadingMore)
            {
                storyData = await DataRequester.RequestCategoryStories(CurrentCategoryId.ToString(), _currentDate);
            }
            else
            {
                ResetStorys();
                storyData = await DataRequester.RequestCategoryLatestStories(CurrentCategoryId.ToString());

                if (storyData != null)
                {
                    var firstStoryId = storyData.stories.First().id;
                    TopStoryList = new List <TopStory>()
                    {
                        new TopStory()
                        {
                            image = storyData.background, id = Misc.Unvalid_Image_Id, title = storyData.description
                        }
                    };
                    CurrentStoryId = firstStoryId.ToString();
                }
            }
            if (storyData == null || storyData.stories.Count == 0)
            {
                return;
            }

            _currentDate = storyData.stories.Last().id.ToString();

            StoryDataList.AddRange(storyData.stories);
        }