Exemple #1
0
        public DefaultTextGallery()
        {
            var descriptionLabel = new Label
            {
                Text   = "No DataTemplates; just using the ToString() of the objects in the source.",
                Margin = new Thickness(2, 2, 2, 2)
            };

            Title = "Default Text Galleries";

            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        // TODO hartez 2018-06-05 10:43 AM Need a gallery page which allows layout selection
                        // so we can demonstrate switching between them
                        descriptionLabel,
                        GalleryBuilder.NavButton("Vertical List (Code)", () =>
                                                 new TextCodeCollectionViewGallery(LinearItemsLayout.Vertical), Navigation),
                        GalleryBuilder.NavButton("Horizontal List (Code)", () =>
                                                 new TextCodeCollectionViewGallery(LinearItemsLayout.Horizontal), Navigation),
                        GalleryBuilder.NavButton("Vertical Grid (Code)", () =>
                                                 new TextCodeCollectionViewGridGallery(), Navigation),
                        GalleryBuilder.NavButton("Horizontal Grid (Code)", () =>
                                                 new TextCodeCollectionViewGridGallery(ItemsLayoutOrientation.Horizontal), Navigation),
                    }
                }
            };
        }
Exemple #2
0
        public PropagationGallery()
        {
            var descriptionLabel =
                new Label {
                Text = "Property Propagation Galleries", Margin = new Thickness(2, 2, 2, 2)
            };

            Title = "Property Propagation Galleries";

            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        descriptionLabel,
                        GalleryBuilder.NavButton("Propagate FlowDirection",                                           () =>
                                                 new PropagateCodeGallery(LinearItemsLayout.Vertical),                Navigation),

                        GalleryBuilder.NavButton("Propagate FlowDirection in EmptyView",                              () =>
                                                 new PropagateCodeGallery(LinearItemsLayout.Vertical,    0), Navigation),
                    }
                }
            };
        }
Exemple #3
0
        public DataTemplateGallery()
        {
            var descriptionLabel =
                new Label {
                Text = "Simple DataTemplate Galleries", Margin = new Thickness(2, 2, 2, 2)
            };

            Title = "Simple DataTemplate Galleries";

            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        descriptionLabel,
                        GalleryBuilder.NavButton("Vertical List (Code)", () =>
                                                 new TemplateCodeCollectionViewGallery(LinearItemsLayout.Vertical), Navigation),
                        GalleryBuilder.NavButton("Horizontal List (Code)", () =>
                                                 new TemplateCodeCollectionViewGallery(LinearItemsLayout.Horizontal), Navigation),
                        GalleryBuilder.NavButton("Vertical Grid (Code)", () =>
                                                 new TemplateCodeCollectionViewGridGallery(), Navigation),
                        GalleryBuilder.NavButton("Horizontal Grid (Code)", () =>
                                                 new TemplateCodeCollectionViewGridGallery(ItemsLayoutOrientation.Horizontal), Navigation),
                        GalleryBuilder.NavButton("DataTemplateSelector", () =>
                                                 new DataTemplateSelectorGallery(), Navigation),
                        GalleryBuilder.NavButton("Varied Size Data Templates", () =>
                                                 new VariedSizeDataTemplateSelectorGallery(), Navigation),
                    }
                }
            };
        }
Exemple #4
0
        public ObservableCollectionGallery()
        {
            var desc = "Observable Collection Galleries";

            var descriptionLabel = new Label {
                Text = desc, Margin = new Thickness(2, 2, 2, 2)
            };

            Title = "Simple DataTemplate Galleries";

            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        descriptionLabel,

                        GalleryBuilder.NavButton("Filter Items",                                                                                                                                                   () => new FilterCollectionView(),              Navigation),

                        GalleryBuilder.NavButton("Add/Remove Items (List)",                                                                                                                                        () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false),                                                                                                             Navigation),

                        GalleryBuilder.NavButton("Add/Remove Items (Grid)",                                                                                                                                        () =>
                                                 new ObservableCodeCollectionViewGallery(),                                                                                                                        Navigation),

                        GalleryBuilder.NavButton("Add/Remove Items (Grid, initially empty)",                                                                                                                       () =>
                                                 new ObservableCodeCollectionViewGallery(initialItems: 0),                                                                                                         Navigation),

                        GalleryBuilder.NavButton("Add/Remove Items (List, initially empty)",                                                                                                                       () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0),                              Navigation),

                        GalleryBuilder.NavButton("Multi-item add/remove, no index",
                                                 () => new ObservableMultiItemCollectionViewGallery(),                                                                                                             Navigation),

                        GalleryBuilder.NavButton("Multi-item add/remove, with index",
                                                 () => new ObservableMultiItemCollectionViewGallery(withIndex: true),                                                                                              Navigation),

                        GalleryBuilder.NavButton("Reset",                                                                                                                                                          () => new ObservableCollectionResetGallery(),  Navigation),

                        GalleryBuilder.NavButton("Add Items with timer to Empty Collection",                                                                                                                       () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0,                               addItemsWithTimer: true),Navigation),

                        GalleryBuilder.NavButton("Reset collection before adding Items with timer to Empty Collection",                                                                                            () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0,                               addItemsWithTimer: true, resetBeforeAddItemsWithTimer: true), Navigation),

                        GalleryBuilder.NavButton("Scroll mode Keep items in view",                                                                                                                                 () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0,                               addItemsWithTimer: true, scrollMode: ItemsUpdatingScrollMode.KeepItemsInView), Navigation),

                        GalleryBuilder.NavButton("Scroll mode Keep scroll offset",                                                                                                                                 () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0,                               addItemsWithTimer: true, scrollMode: ItemsUpdatingScrollMode.KeepScrollOffset), Navigation),

                        GalleryBuilder.NavButton("Scroll mode Keep last item in view",                                                                                                                             () =>
                                                 new ObservableCodeCollectionViewGallery(grid: false,                                                                                                              initialItems: 0,                               addItemsWithTimer: true, scrollMode: ItemsUpdatingScrollMode.KeepLastItemInView), Navigation)
                    }
                }
            };
        }
Exemple #5
0
        public ScrollToGallery()
        {
            var descriptionLabel =
                new Label {
                Text = "ScrollTo Galleries", Margin = new Thickness(2, 2, 2, 2)
            };

            Title = "ScrollTo Galleries";

            Content = new ScrollView
            {
                Content = new StackLayout
                {
                    Children =
                    {
                        descriptionLabel,
                        GalleryBuilder.NavButton("ScrollTo Index (Code, Horizontal List)",                                                         () =>
                                                 new ScrollToCodeGallery(LinearItemsLayout.Horizontal),                                            Navigation),
                        GalleryBuilder.NavButton("ScrollTo Index (Code, Vertical List)",                                                           () =>
                                                 new ScrollToCodeGallery(LinearItemsLayout.Vertical),                                              Navigation),
                        GalleryBuilder.NavButton("ScrollTo Index (Code, Horizontal Grid)",                                                         () =>
                                                 new ScrollToCodeGallery(new GridItemsLayout(3,                                                    ItemsLayoutOrientation.Horizontal)),
                                                 Navigation),
                        GalleryBuilder.NavButton("ScrollTo Index (Code, Vertical Grid)",                                                           () =>
                                                 new ScrollToCodeGallery(new GridItemsLayout(3,                                                    ItemsLayoutOrientation.Vertical)),
                                                 Navigation),

                        GalleryBuilder.NavButton("ScrollTo Item (Code, Horizontal List)",                                                          () =>
                                                 new ScrollToCodeGallery(LinearItemsLayout.Horizontal,                                             ScrollToMode.Element,
                                                                         ExampleTemplates.ScrollToItemTemplate),                                   Navigation),
                        GalleryBuilder.NavButton("ScrollTo Item (Code, Vertical List)",                                                            () =>
                                                 new ScrollToCodeGallery(LinearItemsLayout.Vertical,                                               ScrollToMode.Element,
                                                                         ExampleTemplates.ScrollToItemTemplate),                                   Navigation),
                        GalleryBuilder.NavButton("ScrollTo Item (Code, Horizontal Grid)",                                                          () =>
                                                 new ScrollToCodeGallery(new GridItemsLayout(3,                                                    ItemsLayoutOrientation.Horizontal),
                                                                         ScrollToMode.Element,                                                     ExampleTemplates.ScrollToItemTemplate), Navigation),
                        GalleryBuilder.NavButton("ScrollTo Item (Code, Vertical Grid)",                                                            () =>
                                                 new ScrollToCodeGallery(new GridItemsLayout(3,                                                    ItemsLayoutOrientation.Vertical),
                                                                         ScrollToMode.Element,                                                     ExampleTemplates.ScrollToItemTemplate), Navigation),


                        GalleryBuilder.NavButton("ScrollTo Index (Grouped)",                                                                       () =>
                                                 new ScrollToGroup(),                                                                              Navigation)
                    }
                }
            };
        }