示例#1
0
        public IndexPageViewModel()
        {
            var layouts = new ControlGroup("Layouts", new List <ControlType>
            {
                new ControlType
                {
                    Title = nameof(StackLayout), ControlTemplate = nameof(StackLayoutControlTemplate),
                    Icon  = "layout-StackLayout"
                },
                new ControlType {
                    Title = nameof(Frame), Icon = "layout-Frame"
                },
                new ControlType {
                    Title = nameof(Grid), Icon = "layout-Grid"
                },
                new ControlType {
                    Title = nameof(FlexLayout), Icon = "layout-FlexLayout"
                },
                new ControlType {
                    Title = nameof(AbsoluteLayout), Icon = "layout-AbsoluteLayout"
                },
                new ControlType {
                    Title = nameof(RelativeLayout), Icon = "layout-RelativeLayout"
                },
                // new ControlType{ Title = nameof(ContentPresenter)},
                // new ControlType{ Title = nameof(ContentView)},
                new ControlType {
                    Title = nameof(ScrollView), Icon = "layout-ScrollView"
                },
                // new ControlType{ Title = nameof(TemplatedView)}
            });;

            var pages = new ControlGroup("Pages", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ContentPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(TabbedPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(MasterDetailPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(NavigationPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(CarouselPage), GroupIndex = 1
                }
            });

            var views = new ControlGroup("Views", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ActivityIndicator), GroupIndex = 2, Icon = "view-ActivityIndicator"
                },
                new ControlType {
                    Title = nameof(Button), GroupIndex = 2, Icon = "view-Button"
                },
                new ControlType {
                    Title = nameof(Editor), GroupIndex = 2, Icon = "view-Editor"
                },
                new ControlType {
                    Title = nameof(Entry), GroupIndex = 2, Icon = "view-Entry"
                },
                new ControlType {
                    Title = nameof(ListView), GroupIndex = 2, Icon = "view-ListView"
                },
                new ControlType {
                    Title = nameof(CollectionView), GroupIndex = 2, Icon = "view-ListView"
                },
                new ControlType {
                    Title = nameof(DatePicker), GroupIndex = 2, Icon = "view-DatePicker"
                },
                new ControlType {
                    Title = nameof(TimePicker), GroupIndex = 2, Icon = "view-TimePicker"
                },
                new ControlType {
                    Title = nameof(Picker), GroupIndex = 2, Icon = "view-Picker"
                },
                new ControlType {
                    Title = nameof(Stepper), GroupIndex = 2, Icon = "view-Stepper"
                },
                new ControlType {
                    Title = nameof(BoxView), GroupIndex = 2, Icon = "view-BoxView"
                },
                new ControlType {
                    Title = nameof(Switch), GroupIndex = 2, Icon = "view-Switch"
                },
                new ControlType {
                    Title = nameof(ProgressBar), GroupIndex = 2, Icon = "view-ProgressBar"
                },
                new ControlType {
                    Title = nameof(Label), GroupIndex = 2, Icon = "view-Label"
                },
                new ControlType {
                    Title = nameof(Image), GroupIndex = 2, Icon = "view-Image"
                },
                new ControlType {
                    Title = nameof(ImageButton), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(SearchBar), GroupIndex = 2, Icon = "view-SearchBar"
                },
                new ControlType {
                    Title = nameof(WebView), GroupIndex = 2, Icon = "view-WebView"
                },
                new ControlType {
                    Title = nameof(Map), GroupIndex = 2, Icon = "view-Map"
                },
                new ControlType {
                    Title = nameof(RadioButton), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(CheckBox), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(CarouselView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(IndicatorView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(RefreshView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(SwipeView), GroupIndex = 2
                }
            });

            XamarinAll = new List <ControlGroup>();
            XamarinAll.Add(layouts);
            XamarinAll.Add(views);
            XamarinAll.Add(pages);


            SelectCommand = new Command(ControlSelected);
        }
示例#2
0
        public IndexPageViewModel()
        {
            var layouts = new ControlGroup("Layouts", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(StackLayout), ControlTemplate = nameof(StackLayoutControlTemplate)
                },
                new ControlType {
                    Title = nameof(Frame)
                },
                new ControlType {
                    Title = nameof(Grid)
                },
                new ControlType {
                    Title = nameof(FlexLayout)
                },
                new ControlType {
                    Title = nameof(AbsoluteLayout)
                },
                new ControlType {
                    Title = nameof(RelativeLayout)
                },
                new ControlType {
                    Title = nameof(ContentPresenter)
                },
                new ControlType {
                    Title = nameof(ContentView)
                },
                new ControlType {
                    Title = nameof(ScrollView)
                },
                new ControlType {
                    Title = nameof(TemplatedView)
                }
            });;

            var pages = new ControlGroup("Pages", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ContentPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(TabbedPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(MasterDetailPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(NavigationPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(CarouselPage), GroupIndex = 1
                }
            });

            var views = new ControlGroup("Views", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ActivityIndicator), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Button), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Editor), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Entry), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(ListView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(CollectionView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(DatePicker), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(TimePicker), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Picker), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Stepper), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(BoxView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Switch), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(ProgressBar), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Label), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(Image), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(ImageButton), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(SearchBar), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(WebView), GroupIndex = 2
                }
            });

            XamarinAll = new List <ControlGroup>();
            XamarinAll.Add(layouts);
            XamarinAll.Add(pages);
            XamarinAll.Add(views);


            SelectCommand = new Command(ControlSelected);
        }
示例#3
0
        public IndexPageViewModel()
        {
            var layouts = new ControlGroup("Layouts", new List <ControlType>
            {
                new ControlType
                {
                    Title = nameof(StackLayout), ControlTemplate = nameof(StackLayoutControlTemplate),
                    Icon  = "layout_stacklayout.png"
                },
                new ControlType {
                    Title = nameof(Frame), Icon = "layout_frame.png"
                },
                new ControlType {
                    Title = nameof(Grid), Icon = "layout_grid.png"
                },
                new ControlType {
                    Title = nameof(FlexLayout), Icon = "layout_flexlayout.png"
                },
                new ControlType {
                    Title = nameof(AbsoluteLayout), Icon = "layout_absolutelayout.png"
                },
                new ControlType {
                    Title = nameof(RelativeLayout), Icon = "layout_relativelayout.png"
                },
                new ControlType {
                    Title = nameof(ScrollView), Icon = "layout_scrollview.png"
                },
            });

            var pages = new ControlGroup("Pages", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ContentPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(TabbedPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(FlyoutPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(NavigationPage), GroupIndex = 1
                },
                new ControlType {
                    Title = nameof(CarouselPage), GroupIndex = 1
                }
            });

            var views = new ControlGroup("Views", new List <ControlType>
            {
                new ControlType {
                    Title = nameof(ActivityIndicator), GroupIndex = 2, Icon = "view_activityindicator.png"
                },
                new ControlType {
                    Title = nameof(Button), GroupIndex = 2, Icon = "view_button.png"
                },
                new ControlType {
                    Title = nameof(Editor), GroupIndex = 2, Icon = "view_editor.png"
                },
                new ControlType {
                    Title = nameof(Entry), GroupIndex = 2, Icon = "view_entry.png"
                },
                new ControlType {
                    Title = nameof(ListView), GroupIndex = 2, Icon = "view_listview.png"
                },
                new ControlType {
                    Title = nameof(CollectionView), GroupIndex = 2, Icon = "view_listview.png"
                },
                new ControlType {
                    Title = nameof(DatePicker), GroupIndex = 2, Icon = "view_datepicker.png"
                },
                new ControlType {
                    Title = nameof(TimePicker), GroupIndex = 2, Icon = "view_timepicker.png"
                },
                new ControlType {
                    Title = nameof(Picker), GroupIndex = 2, Icon = "view_picker.png"
                },
                new ControlType {
                    Title = nameof(Stepper), GroupIndex = 2, Icon = "view_stepper.png"
                },
                new ControlType {
                    Title = nameof(BoxView), GroupIndex = 2, Icon = "view_boxview.png"
                },
                new ControlType {
                    Title = nameof(Switch), GroupIndex = 2, Icon = "view_switch.png"
                },
                new ControlType {
                    Title = nameof(ProgressBar), GroupIndex = 2, Icon = "view_progressbar.png"
                },
                new ControlType {
                    Title = nameof(Label), GroupIndex = 2, Icon = "view_label.png"
                },
                new ControlType {
                    Title = nameof(Image), GroupIndex = 2, Icon = "view_image.png"
                },
                new ControlType {
                    Title = nameof(ImageButton), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(SearchBar), GroupIndex = 2, Icon = "view_searchbar.png"
                },
                new ControlType {
                    Title = nameof(WebView), GroupIndex = 2, Icon = "view_webview.png"
                },
                new ControlType {
                    Title = nameof(Map), GroupIndex = 2, Icon = "view_map.png"
                },
                new ControlType {
                    Title = nameof(RadioButton), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(CheckBox), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(CarouselView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(IndicatorView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(RefreshView), GroupIndex = 2
                },
                new ControlType {
                    Title = nameof(SwipeView), GroupIndex = 2
                }
            });

            Layouts = layouts;
            Views   = views;
            Pages   = pages;

            XamarinAll = new List <ControlGroup>();
            XamarinAll.Add(layouts);
            XamarinAll.Add(views);
            XamarinAll.Add(pages);

            NavToDetailCommand = new Command <ControlType>(OnNav);
        }