public async Task RefreshProofRequests(string tab = null) { try { RefreshingProofRequests = true; ProofRequests.Clear(); var agentContext = await _agentContextProvider.GetContextAsync(); IEnumerable <ProofRecord> proofRequests = null; if (tab == null || tab.Equals(nameof(ProofState.Requested))) { proofRequests = await _proofService.ListRequestedAsync(agentContext); } else if (tab.Equals(nameof(ProofState.Accepted))) { proofRequests = await _proofService.ListAcceptedAsync(agentContext); } else if (tab.Equals(nameof(ProofState.Proposed))) { proofRequests = await _proofService.ListProposedAsync(agentContext); } IList <ProofRequestViewModel> proofRequestVms = new List <ProofRequestViewModel>(); foreach (var proofReq in proofRequests) { var connection = (proofReq.ConnectionId == null) ? null : await _connectionService.GetAsync(agentContext, proofReq.ConnectionId); var proofRequestViewModel = _scope.Resolve <ProofRequestViewModel>(new NamedParameter("proofRecord", proofReq), new NamedParameter("connection", connection)); proofRequestVms.Add(proofRequestViewModel); } ProofRequests.InsertRange(proofRequestVms); HasRequests = ProofRequests.Any(); } catch (Exception xx) { await UserDialogs.Instance.AlertAsync(xx.Message); Debug.WriteLine(xx.StackTrace); } finally { RefreshingProofRequests = false; } }