예제 #1
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);
        }