// Set up AboutPage UI private void PageLayout() { Title = viewModel.Title; // Gird Grid grid = LayoutMaker.NewGrid(2, 0); grid.RowDefinitions[0].Height = GridLength.Auto; grid.RowDefinitions[1].Height = GridLength.Star; // Grid StackLayout StackLayout stackLayout = LayoutMaker.NewStackLayout(new Thickness(0, 0, 0, 0)); stackLayout.BackgroundColor = Color.FromHex(VariablesGlobal.COLOUR_ACCENT); stackLayout.VerticalOptions = LayoutOptions.FillAndExpand; stackLayout.HorizontalOptions = LayoutOptions.Fill; ContentView contentView = ViewMaker.NewContentView(new Thickness(0, 40, 0, 40), ViewMaker.NewImageByHeight(VariablesGlobal.IMAGE_XAMARIN_LOGO, LayoutOptions.Center, 64)); contentView.VerticalOptions = LayoutOptions.FillAndExpand; stackLayout.Children.Add(contentView); // ScrollView StackLayout StackLayout contentStackLayout = LayoutMaker.NewStackLayout(new Thickness(16, 40, 16, 40), 10); contentStackLayout.Orientation = StackOrientation.Vertical; contentStackLayout.Children.Add(AppDetailsLabel()); contentStackLayout.Children.Add(AppInformationLabel()); contentStackLayout.Children.Add(AppTextLabel()); contentStackLayout.Children.Add(ViewMaker.NewButtonICommand(viewModel.OpenWebCommand, VariablesTexts.BUTTON_LEARN_MORE)); // Add content to grid grid.Children.Add(stackLayout, 0, 0); grid.Children.Add(LayoutMaker.NewScrollView(contentStackLayout), 0, 1); Content = grid; }
// Set up ItemsPage UI private void PageLayout() { StackLayout stackLayoutView = LayoutMaker.NewStackLayout(new Thickness(0, 0, 0, 0)); foreach (Item item in viewModel.GetItems()) { Button button = new Button() { Text = VariablesTexts.BUTTON_NAME_VIEW, Command = new Command(() => { Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item))); }), }; StackLayout stackLayout = LayoutMaker.NewStackLayout(new Thickness(0, 0, 0, 0)); stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_NAME)); stackLayout.Children.Add(ViewMaker.NewLabelString(item.Name)); stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_TEXT)); stackLayout.Children.Add(ViewMaker.NewLabelString(item.Text)); stackLayout.Children.Add(button); stackLayoutView.Children.Add(stackLayout); } Content = LayoutMaker.NewScrollView(stackLayoutView); }