public async Task Load(Repository repository) { if (GlobalHelper.IsInternet()) { Repository = repository; OpenPaginationIndex = ClosedPaginationIndex = 0; /*Clear off Issues of the previous repository*/ if (OpenIssues != null) { OpenIssues.Clear(); } if (ClosedIssues != null) { ClosedIssues.Clear(); } if (MyIssues != null) { MyIssues.Clear(); } IsLoadingOpen = true; OpenPaginationIndex++; OpenIssues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest { State = ItemStateFilter.Open }, OpenPaginationIndex); IsLoadingOpen = false; ZeroOpenIssues = OpenIssues.Count == 0 ? true : false; } }
public async Task Load(Repository repository) { if (!GlobalHelper.IsInternet()) { Messenger.Default.Send(new GlobalHelper.NoInternetMessageType()); //Sending NoInternet message to all viewModels } else { Messenger.Default.Send(new GlobalHelper.HasInternetMessageType()); //Sending Internet available message to all viewModels ProgressBarValue = 0; isLoading = true; //For the progressBar at the top of the page IsLoadingOpen = IsLoadingClosed = IsLoadingMine = true; Repository = repository; /*Clear off Issues of the previous repository*/ if (OpenIssues != null) { OpenIssues.Clear(); } if (ClosedIssues != null) { ClosedIssues.Clear(); } if (MyIssues != null) { MyIssues.Clear(); } OpenIssues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest { State = ItemStateFilter.Open }); IsLoadingOpen = false; ProgressBarValue += 100 / 3; ZeroOpenIssues = OpenIssues.Count == 0 ? true : false; ClosedIssues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest { State = ItemStateFilter.Closed }); IsLoadingClosed = false; ProgressBarValue += 100 / 3; ZeroClosedIssues = ClosedIssues.Count == 0 ? true : false; MyIssues = await RepositoryUtility.GetAllIssuesForRepoByUser(Repository.Id); ProgressBarValue += 100 / 3; IsLoadingMine = false; ZeroMyIssues = MyIssues.Count == 0 ? true : false; isLoading = false; } }
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); } }
public async Task Load(Repository repository) { if (!GlobalHelper.IsInternet()) { Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType { Message = "No Internet", Glyph = "\uE704" }); } else { Repository = repository; OpenPaginationIndex = ClosedPaginationIndex = 0; /*Clear off Issues of the previous repository*/ if (OpenIssues != null) { OpenIssues.Clear(); } if (ClosedIssues != null) { ClosedIssues.Clear(); } if (MyIssues != null) { MyIssues.Clear(); } IsLoadingOpen = true; OpenPaginationIndex++; OpenIssues = await RepositoryUtility.GetAllIssuesForRepo(Repository.Id, new RepositoryIssueRequest { State = ItemStateFilter.Open }, OpenPaginationIndex); IsLoadingOpen = false; ZeroOpenIssues = OpenIssues.Count == 0 ? true : false; } }