Пример #1
0
        // 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;
        }
Пример #2
0
        // 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);
        }
Пример #3
0
        // Set up ItemDetailPage UI
        private void PageLayout(ItemDetailViewModel viewModel)
        {
            Title = viewModel.Title;

            StackLayout stackLayout = LayoutMaker.NewStackLayout(new Thickness(0, 0, 0, 0));

            stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_NAME, VariablesGlobal.TEXT_SIZE_LARGE));
            stackLayout.Children.Add(ViewMaker.NewLabelString(viewModel.Item.Text));
            stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_TEXT, VariablesGlobal.TEXT_SIZE_LARGE));
            stackLayout.Children.Add(ViewMaker.NewLabelString(viewModel.Item.Name));

            Content = stackLayout;
        }
Пример #4
0
        // Set up NewItemPage UI layout
        private void PageLayout()
        {
            Title = VariablesTexts.TOOLBAR_NAME_ADD;

            StackLayout stackLayout = LayoutMaker.NewStackLayout(new Thickness(0, 0, 0, 0));

            entryName  = InputViewMaker.NewEntry();
            editorText = InputViewMaker.NewEditor();

            stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_NAME, VariablesGlobal.TEXT_SIZE_LARGE));
            stackLayout.Children.Add(entryName);
            stackLayout.Children.Add(ViewMaker.NewLabelString(VariablesTexts.LABEL_ITEM_TEXT, VariablesGlobal.TEXT_SIZE_LARGE));
            stackLayout.Children.Add(editorText);

            ToolbarItems.Add(MenuItemMaker.NewToolbarItem(Save_Clicked, VariablesTexts.TOOLBAR_NAME_SAVE));
            Content = stackLayout;
        }