private void SetPatternList() { IsDownloading = true; var patterns = _brainstormingService.DownloadPatternIdeas(); var groupedPatterns = patterns.GroupBy(p => p.Category); foreach (var group in groupedPatterns) { var patternList = new GroupedPatternList(); var patternIdeaModels = group.Select(p => new PatternIdeaModel(p)).ToList(); patternIdeaModels.ForEach((p) => { _brainstormingService.SetPictureImageSource(p); }); patternList.AddRange(patternIdeaModels); patternList.Category = group.Key; GroupedPatterns.Add(patternList); } IsDownloading = false; }
private async Task DownloadImage(Idea idea) { await _brainstormingService.SetPictureImageSource(idea); }