private async void Load(User model) { if (model.Description != null) { ProfileLayout.Children.Add(InfoFrame.Create("info.png", "Descripció", model.Description)); } if (model.RepositoryUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("repo.png", "Repositori", model.RepositoryUrl)); } if (model.WebsiteUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("web.png", "Pàgina web", model.WebsiteUrl)); } if (model.FacebookUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("facebook.png", "Facebook", model.FacebookUrl)); } if (model.TwitterUrl != null) { ProfileLayout.Children.Add(InfoFrame.Create("twitter.png", "twitter", model.TwitterUrl)); } }
private async void Load() { Title = Model.Title; await ApiService.Projects.AddView(Model.Id); if (Model.Forum != null) { Frame forumframe = InfoFrame.Create("book_b.png", "Fòrum", Model.Forum.Title); TapGestureRecognizer forumTap = new TapGestureRecognizer(); forumTap.Tapped += ForumTap_Tapped; forumframe.GestureRecognizers.Add(forumTap); ProjectStackLayout.Children.Add(forumframe); } if (Model.TotalMoney > 0) { string money = Model.TotalMoney + " €"; ProjectStackLayout.Children.Add(InfoFrame.Create("loading.png", "Progrès", money)); } if (Model.WebsiteUrl != null) { ProjectStackLayout.Children.Add(InfoFrame.Create("web.png", "Pàgina web", Model.WebsiteUrl)); } if (Model.RepositoryUrl != null) { ProjectStackLayout.Children.Add(InfoFrame.Create("repo.png", "Repositori", Model.RepositoryUrl)); } if (Model.Owner.Id == Settings.GetLoggedUser().Id) { ToolbarItem edit = new ToolbarItem { Icon = "edit_w.png", Text = "Editar" }; edit.Clicked += Edit_Clicked; ToolbarItem delete = new ToolbarItem { Icon = "cross_w.png", Text = "Eliminar" }; delete.Clicked += Delete_Clicked; ToolbarItems.Add(edit); ToolbarItems.Add(delete); } else if (Subscribed) { GenerateContributions(); } }