public SpeakerDetailsViewModel(Speaker speaker, string sessionId) : base() { Speaker = speaker; this.sessionId = sessionId; if (!string.IsNullOrWhiteSpace(speaker.CompanyWebsiteUrl)) { FollowItems.Add(new MenuItem { Name = "Web", Subtitle = speaker.CompanyWebsiteUrl, Parameter = speaker.CompanyWebsiteUrl, Icon = "icon_website.png" }); } if (!string.IsNullOrWhiteSpace(speaker.BlogUrl)) { FollowItems.Add(new MenuItem { Name = "Blog", Subtitle = speaker.BlogUrl, Parameter = speaker.BlogUrl, Icon = "icon_blog.png" }); } if (!string.IsNullOrWhiteSpace(speaker.TwitterUrl)) { FollowItems.Add(new MenuItem { Name = Device.OS == TargetPlatform.iOS ? "Twitter" : speaker.TwitterUrl, Subtitle = $"@{speaker.TwitterUrl}", Parameter = "http://twitter.com/" + speaker.TwitterUrl, Icon = "icon_twitter.png" }); } if (!string.IsNullOrWhiteSpace(speaker.LinkedInUrl)) { FollowItems.Add(new MenuItem { Name = "LinkedIn", Subtitle = speaker.LinkedInUrl, Parameter = "http://linkedin.com/in/" + speaker.LinkedInUrl, Icon = "icon_linkedin.png" }); } }
private void SpeakerSelected(Speaker speaker) { SelectedSpeaker = speaker; if (!string.IsNullOrWhiteSpace(speaker.CompanyWebsiteUrl)) { FollowItems.Add(new Models.MenuItem { Name = "Web", Subtitle = speaker.CompanyWebsiteUrl, Parameter = speaker.CompanyWebsiteUrl, Icon = "icon_website.png" }); } if (!string.IsNullOrWhiteSpace(speaker.BlogUrl)) { FollowItems.Add(new Models.MenuItem { Name = "Blog", Subtitle = speaker.BlogUrl, Parameter = speaker.BlogUrl, Icon = "icon_blog.png" }); } if (!string.IsNullOrWhiteSpace(speaker.TwitterUrl)) { FollowItems.Add(new Models.MenuItem { Name = Device.OS == TargetPlatform.iOS ? "Twitter" : speaker.TwitterUrl, Subtitle = $"@{speaker.TwitterUrl}", Parameter = "http://twitter.com/" + speaker.TwitterUrl, Icon = "icon_twitter.png" }); } if (!string.IsNullOrWhiteSpace(speaker.LinkedInUrl)) { FollowItems.Add(new Models.MenuItem { Name = "Social", Subtitle = speaker.LinkedInUrl, Parameter = speaker.LinkedInUrl, Icon = "icon_linkedin.png" }); } }
private void SponsorSelected(Sponsor selectedSponsor) { SelectedSponsor = selectedSponsor; FollowItems.Add(new Models.MenuItem { Name = "Web", Subtitle = SelectedSponsor.WebsiteUrl, Parameter = SelectedSponsor.WebsiteUrl, Icon = "icon_website.png" }); FollowItems.Add(new Models.MenuItem { Name = Device.OS == TargetPlatform.iOS ? "Twitter" : SelectedSponsor.TwitterUrl, Subtitle = $"@{SelectedSponsor.TwitterUrl}", Parameter = "http://twitter.com/" + SelectedSponsor.TwitterUrl, Icon = "icon_twitter.png" }); FollowsCount = FollowItems.Count; }
public SpeakerDetailsViewModel(Speaker speaker, string sessionId) : base() { Speaker = speaker; this.sessionId = sessionId; MessagingService.Current.Subscribe <Session>(MessageKeys.SessionFavoriteToggled, UpdateFavoritedSession); if (!string.IsNullOrWhiteSpace(speaker.CompanyWebsiteUrl)) { FollowItems.Add(new MenuItem { Name = speaker.CompanyWebsiteUrl.StripUrlForDisplay(), Parameter = speaker.CompanyWebsiteUrl, Icon = "icon_website.png" }); } if (!string.IsNullOrWhiteSpace(speaker.BlogUrl)) { FollowItems.Add(new MenuItem { Name = speaker.BlogUrl.StripUrlForDisplay(), Parameter = speaker.BlogUrl, Icon = "icon_blog.png" }); } if (!string.IsNullOrWhiteSpace(speaker.TwitterUrl)) { var twitterValue = speaker.TwitterUrl.CleanUpTwitter(); FollowItems.Add(new MenuItem { Name = $"@{twitterValue}", Parameter = "https://twitter.com/" + twitterValue, Icon = "icon_twitter.png" }); } if (!string.IsNullOrWhiteSpace(speaker.FacebookProfileName)) { var profileName = speaker.FacebookProfileName.GetLastPartOfUrl(); var profileDisplayName = profileName; Int64 testProfileId; if (Int64.TryParse(profileName, out testProfileId)) { profileDisplayName = "Facebook"; } FollowItems.Add(new MenuItem { Name = profileDisplayName, Parameter = "https://facebook.com/" + profileName, Icon = "icon_facebook.png" }); } if (!string.IsNullOrWhiteSpace(speaker.LinkedInUrl)) { FollowItems.Add(new MenuItem { Name = "LinkedIn", Parameter = speaker.LinkedInUrl.StripUrlForDisplay(), Icon = "icon_linkedin.png" }); } }