Ejemplo n.º 1
0
        public async Task OpenIncrementalLoad()
        {
            OpenPaginationIndex++;
            IsIncrementalLoadingOpen = true;
            var issues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest
            {
                State = ItemStateFilter.Open
            },
                                                                     OpenPaginationIndex);

            IsIncrementalLoadingOpen = false;

            if (issues != null)
            {
                if (issues.Count > 0)
                {
                    foreach (var i in issues)
                    {
                        OpenIssues.Add(i);
                    }
                }
                else
                {
                    //no more issues left to load
                    OpenPaginationIndex = -1;
                }
            }
        }
Ejemplo n.º 2
0
        private async void RefreshIssues()
        {
            OpenIssues.Clear();
            ClosedIssues.Clear();

            var items = await _githubService.GetIssuesAsync();

            foreach (var item in items
                     .Where(x => x.state.Equals("open"))
                     .Select(x => new IssueViewModel(x)))
            {
                OpenIssues.Add(item);
            }
            foreach (var item in items
                     .Where(x => !x.state.Equals("open"))
                     .Select(x => new IssueViewModel(x)))
            {
                ClosedIssues.Add(item);
            }
        }