CarouselCustomizationPage.xaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.CarouselCustomizationPage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="260">
  6. <StackPanel Margin="12" Spacing="8">
  7. <TextBlock Text="Configuration" FontWeight="SemiBold" FontSize="16"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock Text="Navigation" FontWeight="SemiBold" FontSize="13" />
  10. <Button x:Name="PreviousButton"
  11. Content="Previous"
  12. HorizontalAlignment="Stretch" />
  13. <Button x:Name="NextButton"
  14. Content="Next"
  15. HorizontalAlignment="Stretch" />
  16. <Separator />
  17. <TextBlock Text="Orientation" FontWeight="SemiBold" FontSize="13" />
  18. <ComboBox x:Name="OrientationCombo"
  19. HorizontalAlignment="Stretch"
  20. SelectedIndex="0">
  21. <ComboBoxItem>Horizontal</ComboBoxItem>
  22. <ComboBoxItem>Vertical</ComboBoxItem>
  23. </ComboBox>
  24. <TextBlock Text="Viewport Fraction" FontWeight="SemiBold" FontSize="13" />
  25. <Grid ColumnDefinitions="*,48" ColumnSpacing="8">
  26. <Slider x:Name="ViewportSlider"
  27. Minimum="0.33"
  28. Maximum="1.0"
  29. Value="1.0"
  30. TickFrequency="0.01"
  31. HorizontalAlignment="Stretch" />
  32. <TextBlock x:Name="ViewportLabel"
  33. Grid.Column="1"
  34. Text="1.00"
  35. VerticalAlignment="Center"
  36. HorizontalAlignment="Right"
  37. FontWeight="SemiBold" />
  38. </Grid>
  39. <TextBlock x:Name="ViewportHint"
  40. Text="1.00 shows a single full page."
  41. FontSize="11"
  42. Opacity="0.6"
  43. TextWrapping="Wrap" />
  44. <Separator />
  45. <TextBlock Text="Options" FontWeight="SemiBold" FontSize="14" />
  46. <CheckBox x:Name="WrapSelectionCheck"
  47. Content="Wrap Selection"
  48. IsChecked="False"
  49. IsCheckedChanged="OnWrapSelectionChanged" />
  50. <CheckBox x:Name="SwipeEnabledCheck"
  51. Content="Swipe Enabled"
  52. IsChecked="False"
  53. IsCheckedChanged="OnSwipeEnabledChanged" />
  54. <Separator />
  55. <TextBlock Text="Status" FontWeight="SemiBold" FontSize="14" />
  56. <TextBlock x:Name="StatusText"
  57. Text="Orientation: Horizontal"
  58. Opacity="0.7"
  59. TextWrapping="Wrap" />
  60. </StackPanel>
  61. </ScrollViewer>
  62. <Border DockPanel.Dock="Right" Width="1"
  63. Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  64. <Border Margin="12"
  65. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  66. BorderThickness="1"
  67. CornerRadius="6"
  68. ClipToBounds="True">
  69. <Carousel x:Name="DemoCarousel" Height="300">
  70. <Carousel.PageTransition>
  71. <PageSlide Duration="0.25" Orientation="Horizontal" />
  72. </Carousel.PageTransition>
  73. <Border Margin="14,12" CornerRadius="12" ClipToBounds="True">
  74. <Grid>
  75. <Image Source="/Assets/delicate-arch-896885_640.jpg" Stretch="UniformToFill" />
  76. <Border Background="#80000000" VerticalAlignment="Bottom" Padding="12">
  77. <TextBlock Text="Item 1: Delicate Arch" Foreground="White"
  78. HorizontalAlignment="Center" FontWeight="SemiBold" />
  79. </Border>
  80. </Grid>
  81. </Border>
  82. <Border Margin="14,12" CornerRadius="12" ClipToBounds="True">
  83. <Grid>
  84. <Image Source="/Assets/hirsch-899118_640.jpg" Stretch="UniformToFill" />
  85. <Border Background="#80000000" VerticalAlignment="Bottom" Padding="12">
  86. <TextBlock Text="Item 2: Hirsch" Foreground="White"
  87. HorizontalAlignment="Center" FontWeight="SemiBold" />
  88. </Border>
  89. </Grid>
  90. </Border>
  91. <Border Margin="14,12" CornerRadius="12" ClipToBounds="True">
  92. <Grid>
  93. <Image Source="/Assets/maple-leaf-888807_640.jpg" Stretch="UniformToFill" />
  94. <Border Background="#80000000" VerticalAlignment="Bottom" Padding="12">
  95. <TextBlock Text="Item 3: Maple Leaf" Foreground="White"
  96. HorizontalAlignment="Center" FontWeight="SemiBold" />
  97. </Border>
  98. </Grid>
  99. </Border>
  100. </Carousel>
  101. </Border>
  102. </DockPanel>
  103. </UserControl>