public async Task ClosedIncrementalLoad() { ClosedPaginationIndex++; IsIncrementalLoadingClosed = true; var issues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest { State = ItemStateFilter.Closed }, ClosedPaginationIndex); IsIncrementalLoadingClosed = false; if (issues != null) { if (issues.Count > 0) { foreach (var i in issues) { ClosedIssues.Add(i); } } else { //no more issues left to load ClosedPaginationIndex = -1; } } }
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); } }