private async void LoadTalents() { try { IsBusy = true; var talents = await SessionHandler.ExecuteOpenbiCommand((s, t) => s.GetMajaTalents(t)); var categories = new Dictionary <string, MajaCategory>(); foreach (var apiTalent in talents) { MajaCategory category = null; if (!categories.TryGetValue(apiTalent.Category.Id, out category)) { categories[apiTalent.Category.Id] = category = new MajaCategory(apiTalent.Category); } var talent = new MajaTalent(apiTalent, category); Talents.Add(talent); if (SessionHandler.Packages.Contains(talent.Id)) { talent.Selected = true; } } } catch (Exception e) { DisplayException(e); } finally { IsBusy = false; } }
public TalentDetailPage(MajaTalent talent, SessionHandler sessionHandler) { InitializeComponent(); BindingContext = ViewModel = new TalentDetailViewModel(talent, sessionHandler); TalentActiveLabel.SizeChanged += TalentActiveLabel_SizeChanged; }