public ProfilePage(GitHubUser user) { InitializeComponent(); User = user; Service = new GitHubService(); if (user != null) { avatar.Source = user.Avatar_Url; username.Text = user.Login; } var pageLayout = (StackLayout)Content; var absolute = new AbsoluteLayout() { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; // Position the pageLayout to fill the entire screen. // Manage positioning of child elements on the page by editing the pageLayout. AbsoluteLayout.SetLayoutFlags(pageLayout, AbsoluteLayoutFlags.All); AbsoluteLayout.SetLayoutBounds(pageLayout, new Rectangle(0f, 0f, 1f, 1f)); absolute.Children.Add(pageLayout); /* #if __ANDROID__ * //let's make a FAB and add it for Android only * var fab = new FloatingActionButton(Forms.Context); * fab.SetImageResource(Android.Resource.Drawable.IcMenuSearch); * * fab.Click += async (sender, e) => * { * await Navigation.PopAsync(); * }; * * // make a layout holder for our FAB * var stack = new StackLayout * { * Padding = 8, * HorizontalOptions = LayoutOptions.Center, * }; * * // add the FAB to it * stack.Children.Add(fab); * absolute.Children.Add(stack); * * // Overlay the FAB in the bottom-right corner * AbsoluteLayout.SetLayoutFlags(stack, AbsoluteLayoutFlags.PositionProportional); * AbsoluteLayout.SetLayoutBounds(stack, new Rectangle(1f, 1f, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize)); #endif */ this.Content = absolute; }
public ProfilePage(GitHubUser user) { InitializeComponent(); User = user; Service = new GitHubService(); if (user != null) { avatar.Source = user.Avatar_Url; username.Text = user.Login; } }