public SkillPage (Skill skill) { Title = skill.name; var skillVideo = new SkillVideoPage (skill); var skillFlashcardPage = new SkillFlashcardPage (skill); this.Children.Add (skillVideo); this.Children.Add (skillFlashcardPage); }
public SkillFlashcardPage (Skill skill) { this.Icon = "Edit.png"; this.Title = "Flashcards"; if(skill.flashcards.Count > 0){ Image im = new Image { Aspect = Aspect.AspectFit}; im.Source = ImageSource.FromUri (new Uri (String.Format ("{0}{1}", Config.API_ENDPOINT, skill.flashcards [0].url))); Content = new ScrollView { Content = im }; }else{ Content = new Label { Text = "This will have flashcards n stuff" } ; } }
public SkillVideoPage (Skill skill) { this.Icon = "Video.png"; this.Title = "Video"; if (skill.videos.Count > 0) { HtmlWebViewSource src = new HtmlWebViewSource { Html = String.Format("<!DOCTYPE html><html><body><iframe width=\"100%\" height=\"500px\" src=\"https://www.youtube.com/embed/{0}\" frameborder=\"0\" allowfullscreen></iframe>", skill.videos[0].youtube_id) }; var videoWebview = new WebView { Source = src }; Content = videoWebview; } else { Content = new Label{ Text = "No video for this skill" }; } }