public SearchPage() { Title = "Search Flight"; NavigationPage.SetBackButtonTitle(this, string.Empty); ToolbarItems.Add(new ToolbarItem("Cancel", null, async() => { await Navigation.PopToRootAsync(); })); var image = new Image { HeightRequest = 275, Source = ImageSource.FromResource("Fly360.images.searchImg.png"), Aspect = Aspect.AspectFill }; var label = new ShadowLabel { Text = "Honolulu", Margin = 20, FontSize = 24, FontAttributes = FontAttributes.Bold, TextColor = Color.White, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.End }; var grid = new Grid { RowDefinitions = { new RowDefinition { Height = GridLength.Star }, new RowDefinition { Height = new GridLength(2, GridUnitType.Star) } } }; var searchForm = new SearchForm() { VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Fill }; Grid.SetRow(searchForm, 1); grid.Children.Add(image); grid.Children.Add(label); grid.Children.Add(searchForm); Content = grid; }
protected override void OnAppearing() { base.OnAppearing(); var image = new Image { HeightRequest = 275, Source = ImageSource.FromResource("office.jpg"), Aspect = Aspect.AspectFill }; var label = new ShadowLabel { Text = $"Callister, Inc. ({Code})", Margin = 20, FontSize = 24, FontAttributes = FontAttributes.Bold, TextColor = Color.White, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.End }; var grid = new Grid { RowDefinitions = { new RowDefinition { Height = GridLength.Star }, new RowDefinition { Height = new GridLength(2, GridUnitType.Star) } } }; var searchForm = new SearchForm(Code) { VerticalOptions = LayoutOptions.Start, HorizontalOptions = LayoutOptions.Fill }; Grid.SetRow(searchForm, 1); grid.Children.Add(image); grid.Children.Add(label); grid.Children.Add(searchForm); Content = grid; }
public ProfilePage() { Title = "Fly 360"; NavigationPage.SetBackButtonTitle(this, string.Empty); var profile = new Image { Source = ImageSource.FromResource("Fly360.images.profile.png"), Aspect = Aspect.AspectFit, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Margin = 5 }; Grid.SetRowSpan(profile, 2); var name = new ShadowLabel { Text = "Jane Doe", FontSize = 24, FontAttributes = FontAttributes.Bold, TextColor = Color.White, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Start }; Grid.SetColumn(name, 1); var role = new Label { FontSize = 16, TextColor = Color.White, Text = "Consultant (Grade: B)", HorizontalTextAlignment = TextAlignment.Start }; Grid.SetColumn(role, 1); Grid.SetRow(role, 1); var box = new BoxView { Color = Color.FromHex("#5579F7") }; Grid.SetRowSpan(box, 2); Grid.SetColumnSpan(box, 2); var grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 75 }, new ColumnDefinition(), }, RowDefinitions = { new RowDefinition { Height = 40 }, new RowDefinition { Height = GridLength.Star } }, Children = { box, profile, name, role } }; Content = grid; }
View GetProfileView() { var profile = new Image { Source = ImageSource.FromResource("Fly360.images.profile.png"), Aspect = Aspect.AspectFit, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, Margin = 5 }; Grid.SetRowSpan(profile, 2); var name = new ShadowLabel { Text = "Jane Doe", FontSize = 24, FontAttributes = FontAttributes.Bold, TextColor = Color.White, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.End }; Grid.SetColumn(name, 1); var role = new Label { FontSize = 16, TextColor = Color.White, Text = "Consultant (Grade: B)", HorizontalTextAlignment = TextAlignment.Start }; Grid.SetColumn(role, 1); Grid.SetRow(role, 1); var box = new BoxView { Color = Color.FromHex("#5579F7") }; Grid.SetRowSpan(box, 2); Grid.SetColumnSpan(box, 3); var button = new Button { BackgroundColor = Color.FromHex("#F2F6F8"), TextColor = Color.FromHex("#5887F9"), Text = "Trips", HorizontalOptions = LayoutOptions.Center, Margin = new Thickness(10, 25), WidthRequest = 150, CornerRadius = 5, }; Grid.SetRow(button, 0); Grid.SetRowSpan(button, 2); Grid.SetColumn(button, 2); button.Clicked += async(s, a) => { await Navigation.PushPopupAsync(popupPage); }; var grid = new Grid { ColumnDefinitions = { new ColumnDefinition { Width = 75 }, new ColumnDefinition(), new ColumnDefinition { Width = 100 }, }, RowDefinitions = { new RowDefinition { Height = 40 }, new RowDefinition { Height = GridLength.Star } }, Children = { box, profile, name, role, button } }; return(grid); }
protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); var extras = new ExtrasView { Keys = new Keys { Mode = "2", SeatImage = "upgradeSeats.png", SeatUrl = "https://fly360.github.io/content/luxuryVR.html", SeatIcon = "iconVR.png", SkyImage = "skyClub.png", SkyUrl = "https://fly360.github.io/content/skyclubVR.html", SkyIcon = "iconVR.png", }, HeightRequest = this.HeightRequest - DraggerButtonHeight, BackgroundColor = Color.White, HorizontalOptions = LayoutOptions.Fill, VerticalOptions = LayoutOptions.Fill }; var upgrade = new Image { Source = ImageSource.FromResource("upgradeIcon.png"), HeightRequest = 20, WidthRequest = 40, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center }; var price = new ShadowLabel { FontSize = 18, FontAttributes = FontAttributes.Bold, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Start, VerticalOptions = LayoutOptions.Center, Margin = new Thickness(15, 10), Text = "+ $50", }; var mainLayout = new StackLayout { Spacing = 0, Children = { new StackLayout { HeightRequest = 40, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, BackgroundColor = Color.FromHex("#5887F9"), Children = { upgrade, price }, Orientation = StackOrientation.Horizontal, GestureRecognizers = { new TapGestureRecognizer(async(obj) => { this.OnTapped?.Invoke(this, EventArgs.Empty); }) } }, extras } }; Content = mainLayout; }