public CollectionViewGallery() { Content = new ScrollView { Content = new StackLayout { Spacing = 5, Children = { GalleryBuilder.NavButton("Default Text Galleries", () => new DefaultTextGallery(), Navigation), GalleryBuilder.NavButton("DataTemplate Galleries", () => new DataTemplateGallery(), Navigation), GalleryBuilder.NavButton("Observable Collection Galleries", () => new ObservableCollectionGallery(), Navigation), GalleryBuilder.NavButton("Snap Points Galleries", () => new SnapPointsGallery(), Navigation), GalleryBuilder.NavButton("ScrollTo Galleries", () => new ScrollToGallery(), Navigation), GalleryBuilder.NavButton("CarouselView Galleries", () => new CarouselViewGallery(), Navigation), GalleryBuilder.NavButton("EmptyView Galleries", () => new EmptyViewGallery(), Navigation), GalleryBuilder.NavButton("Selection Galleries", () => new SelectionGallery(), Navigation), GalleryBuilder.NavButton("Propagation Galleries", () => new PropagationGallery(), Navigation), GalleryBuilder.NavButton("Grouping Galleries", () => new GroupingGallery(), Navigation), GalleryBuilder.NavButton("Item Spacing Galleries", () => new ItemsSpacingGallery(), Navigation), GalleryBuilder.NavButton("Item Size Galleries", () => new ItemsSizeGallery(), Navigation), GalleryBuilder.NavButton("Scroll Mode Galleries", () => new ScrollModeGallery(), Navigation), GalleryBuilder.NavButton("Alternate Layout Galleries", () => new AlternateLayoutGallery(), Navigation), GalleryBuilder.NavButton("Header/Footer Galleries", () => new HeaderFooterGallery(), Navigation), GalleryBuilder.NavButton("Nested CollectionViews", () => new NestedGalleries.NestedCollectionViewGallery(), Navigation), } } }; }
public SnapPointsGallery() { var descriptionLabel = new Label { Text = "Snap Points Galleries", Margin = new Thickness(2, 2, 2, 2) }; Title = "Snap Points Galleries"; Content = new ScrollView { Content = new StackLayout { Children = { descriptionLabel, GalleryBuilder.NavButton("Snap Points (Code, Horizontal List)", () => new SnapPointsCodeGallery(LinearItemsLayout.Horizontal as ItemsLayout), Navigation), GalleryBuilder.NavButton("Snap Points (Code, Vertical List)", () => new SnapPointsCodeGallery(LinearItemsLayout.Vertical as ItemsLayout), Navigation), GalleryBuilder.NavButton("Snap Points (Code, Horizontal Grid)", () => new SnapPointsCodeGallery(new GridItemsLayout(2, ItemsLayoutOrientation.Horizontal)), Navigation), GalleryBuilder.NavButton("Snap Points (Code, Vertical Grid)", () => new SnapPointsCodeGallery(new GridItemsLayout(2, ItemsLayoutOrientation.Vertical)), Navigation), } } }; }
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), } } }; }
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), } } }; }
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), } } }; }
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) } } }; }
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) } } }; }