Esempio n. 1
0
        public async void MonthIncrementalLoad(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            IsIncrementalLoadingMonth = true;
            CanLoadMoreMonth          = false;
            var repos = await RepositoryUtility.GetTrendingRepos(TimeRange.MONTHLY, false);

            IsIncrementalLoadingMonth = false;

            if (repos != null)
            {
                foreach (var i in repos)
                {
                    TrendingReposMonth.Add(i);
                }
            }
        }
Esempio n. 2
0
        public async Task MonthIncrementalLoad()
        {
            IsIncrementalLoadingMonth = true;
            CanLoadMoreMonth          = false;
            var repos = await RepositoryUtility.GetTrendingRepos(TimeRange.MONTHLY, false);

            IsIncrementalLoadingMonth = false;

            if (repos != null)
            {
                foreach (var i in repos)
                {
                    TrendingReposMonth.Add(i);
                }
            }
        }
Esempio n. 3
0
        private async Task LoadTrendingRepos(TimeRange range)
        {
            if (range == TimeRange.TODAY)
            {
                var repos = await RepositoryUtility.GetTrendingRepos(range, true);

                IsLoadingToday = false;
                if (repos != null)
                {
                    TrendingReposToday = repos;

                    IsIncrementalLoadingToday = true;
                    //Second Incremental call
                    repos = await RepositoryUtility.GetTrendingRepos(range, false);

                    IsIncrementalLoadingToday = false;

                    if (repos != null)
                    {
                        foreach (var i in repos)
                        {
                            TrendingReposToday.Add(i);
                        }
                    }
                }
                else
                {
                    ZeroTodayCount = true;
                    if (TrendingReposToday != null)
                    {
                        TrendingReposToday.Clear();
                    }
                }
            }
            else if (range == TimeRange.WEEKLY)
            {
                var repos = await RepositoryUtility.GetTrendingRepos(range, true);

                IsLoadingWeek = false;
                if (repos != null)
                {
                    TrendingReposWeek = repos;

                    IsIncrementalLoadingWeek = true;
                    //Second Incremental call
                    repos = await RepositoryUtility.GetTrendingRepos(range, false);

                    IsIncrementalLoadingWeek = false;

                    if (repos != null)
                    {
                        foreach (var i in repos)
                        {
                            TrendingReposWeek.Add(i);
                        }
                    }
                }
                else
                {
                    ZeroWeeklyCount = true;
                    if (TrendingReposWeek != null)
                    {
                        TrendingReposWeek.Clear();
                    }
                }
            }
            else
            {
                var repos = await RepositoryUtility.GetTrendingRepos(range, true);

                IsLoadingMonth = false;
                if (repos != null)
                {
                    TrendingReposMonth = repos;

                    IsIncrementalLoadingMonth = true;
                    //Second Incremental call
                    repos = await RepositoryUtility.GetTrendingRepos(range, false);

                    IsIncrementalLoadingMonth = false;

                    if (repos != null)
                    {
                        foreach (var i in repos)
                        {
                            TrendingReposMonth.Add(i);
                        }
                    }
                }
                else
                {
                    ZeroMonthlyCount = true;
                    if (TrendingReposMonth != null)
                    {
                        TrendingReposMonth.Clear();
                    }
                }
            }
        }