Beispiel #1
0
        public async void WeekIncrementalLoad(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            IsIncrementalLoadingWeek = true;
            CanLoadMoreWeek          = false;
            var repos = await RepositoryUtility.GetTrendingRepos(TimeRange.WEEKLY, false);

            IsIncrementalLoadingWeek = false;

            if (repos != null)
            {
                foreach (var i in repos)
                {
                    TrendingReposWeek.Add(i);
                }
            }
        }
        public async Task WeekIncrementalLoad()
        {
            IsIncrementalLoadingWeek = true;
            CanLoadMoreWeek          = false;
            var repos = await RepositoryUtility.GetTrendingRepos(TimeRange.WEEKLY, false);

            IsIncrementalLoadingWeek = false;

            if (repos != null)
            {
                foreach (var i in repos)
                {
                    TrendingReposWeek.Add(i);
                }
            }
        }
Beispiel #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();
                    }
                }
            }
        }