public SpeakerPage() { Title = "Speaker"; NavigationPage.SetHasNavigationBar(this, true); var image = new Image(); image.SetBinding(Image.SourceProperty, "HeadshotUrl"); var name = new Label { Text = "Name", FontSize = 18 }; name.SetBinding(Label.TextProperty, "Name"); // Twitter is iOS only for now (see Speaker class for binding calculation) tweetButton = new TweetButton { // BackgroundImage = "tweet.png", Text = "Tweet", }; tweetButton.SetBinding(Button.TextProperty, "TwitterHandle"); tweetButton.SetBinding(Button.IsVisibleProperty, "HasTwitter"); var bio = new Label { Text = "Bio", FontSize = 12 }; bio.SetBinding(Label.TextProperty, "Bio"); var scroll = new ScrollView { Orientation = ScrollOrientation.Vertical, Content = new StackLayout { VerticalOptions = LayoutOptions.StartAndExpand, Padding = new Thickness(20), Children = { image, name, tweetButton, bio } } }; Content = scroll; }
public SpeakerPage () { Title = "Speaker"; NavigationPage.SetHasNavigationBar (this, true); var image = new Image (); image.SetBinding(Image.SourceProperty, "HeadshotUrl"); var name = new Label { Text = "Name", Font = Font.SystemFontOfSize(18) }; name.SetBinding (Label.TextProperty, "Name"); // Twitter is iOS only for now (see Speaker class for binding calculation) tweetButton = new TweetButton { // BackgroundImage = "tweet.png", Text = "Tweet", }; tweetButton.SetBinding (Button.TextProperty, "TwitterHandle"); tweetButton.SetBinding (Button.IsVisibleProperty, "HasTwitter"); var bio = new Label { Text = "Bio", Font = Font.SystemFontOfSize(12) }; bio.SetBinding (Label.TextProperty, "Bio"); var scroll = new ScrollView { Orientation = ScrollOrientation.Vertical, Content = new StackLayout { VerticalOptions = LayoutOptions.StartAndExpand, Padding = new Thickness(20), Children = { image, name, tweetButton, bio } } }; Content = scroll; }