private async Task Populate() { IEnumerable <IViewModel> challenges = await challengeRepository.AllAsync(); List <IViewModel> views = new List <IViewModel>(); views.AddRange(challenges); RunOnUiThread(() => adapter.SetItems(views)); }
private async Task Populate() { var challenges = await challengeRepository.Challenges; var workouts = await workoutRepository.Workouts; var measurements = await measurementRepository.Measurements; List <IViewModel> viewModels = new List <IViewModel>(workouts); viewModels.AddRange(challenges); viewModels.AddRange(measurements); View.Post(() => adapter.SetItems(viewModels)); }