public LoadTasksMessage(Project project) { Project = project; }
private async TTask LoadTasksAsync(Project project) { Tasks.Clear(); IEnumerable<Task> tasks = null; try { tasks = await _apiService.GetListAsync<Task>($"projects/{project.Id}/tasks"); } catch (AccessTokenExpiredException) { // Ugly way of retrying after refreshing a token. try { await _apiService.RefreshAccessTokenAsync(); tasks = await _apiService.GetListAsync<Task>($"projects/{project.Id}/tasks"); } catch { ApiService.RemoveTokenFromVault(); _navService.GoBack(); return; } } foreach (var task in tasks.OrderBy(t => t.Name)) { Tasks.Add(task); } }