PipsPagerPage.xaml.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using Avalonia.Controls;
  3. using Avalonia.Interactivity;
  4. namespace ControlCatalog.Pages
  5. {
  6. public partial class PipsPagerPage : ContentPage
  7. {
  8. private static readonly (string Group, string Title, string Description, Func<UserControl> Factory)[] Demos =
  9. {
  10. ("Getting Started", "First Look",
  11. "Default PipsPager with horizontal and vertical orientation, with and without navigation buttons.",
  12. () => new PipsPagerGettingStartedPage()),
  13. ("Features", "Carousel Integration",
  14. "Bind SelectedPageIndex to a Carousel's SelectedIndex for two-way synchronized page navigation.",
  15. () => new PipsPagerCarouselPage()),
  16. ("Features", "Large Collections",
  17. "Use MaxVisiblePips to limit visible indicators when the page count is large. Pips scroll automatically.",
  18. () => new PipsPagerLargeCollectionPage()),
  19. ("Features", "Events",
  20. "Monitor SelectedPageIndex changes to react to user navigation.",
  21. () => new PipsPagerEventsPage()),
  22. ("Appearance", "Custom Colors",
  23. "Override pip indicator colors using resource keys for normal, selected, and hover states.",
  24. () => new PipsPagerCustomColorsPage()),
  25. ("Appearance", "Custom Button Themes",
  26. "Replace the default chevron navigation buttons with custom button themes.",
  27. () => new PipsPagerCustomButtonThemesPage()),
  28. ("Appearance", "Custom Templates",
  29. "Override pip item templates to create squares, pills, numbers, or any custom shape.",
  30. () => new PipsPagerCustomTemplatesPage()),
  31. ("Showcases", "Care Companion",
  32. "A health care onboarding flow using PipsPager as the page indicator for a CarouselPage.",
  33. () => new CareCompanionAppPage()),
  34. ("Showcases", "Sanctuary",
  35. "A travel discovery app using PipsPager as the page indicator for a CarouselPage.",
  36. () => new SanctuaryShowcasePage()),
  37. };
  38. public PipsPagerPage()
  39. {
  40. InitializeComponent();
  41. Loaded += OnLoaded;
  42. }
  43. private async void OnLoaded(object? sender, RoutedEventArgs e)
  44. {
  45. await SampleNav.PushAsync(NavigationDemoHelper.CreateGalleryHomePage(SampleNav, Demos), null);
  46. }
  47. }
  48. }