CarouselPageDataTemplatePage.xaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. x:Class="ControlCatalog.Pages.CarouselPageDataTemplatePage">
  4. <DockPanel>
  5. <ScrollViewer DockPanel.Dock="Right" Width="240">
  6. <StackPanel Margin="12" Spacing="8">
  7. <TextBlock Text="Data Templates" FontWeight="SemiBold" FontSize="16"
  8. Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
  9. <TextBlock FontSize="12" Opacity="0.7" TextWrapping="Wrap"
  10. Text="Bind a CarouselPage to a view-model collection, render each item with PageTemplate, and switch templates at runtime." />
  11. <Separator />
  12. <Button Content="Add Page" Click="OnAddPage" HorizontalAlignment="Stretch" />
  13. <Button Content="Remove Last" Click="OnRemovePage" HorizontalAlignment="Stretch" />
  14. <Button Content="Switch Template" Click="OnSwitchTemplate" HorizontalAlignment="Stretch" />
  15. <Separator />
  16. <TextBlock Text="Navigate" FontWeight="SemiBold" FontSize="13" />
  17. <StackPanel Spacing="6">
  18. <Button Content="Previous" Click="OnPrevious" HorizontalAlignment="Stretch" />
  19. <Button Content="Next" Click="OnNext" HorizontalAlignment="Stretch" />
  20. </StackPanel>
  21. <Separator />
  22. <TextBlock x:Name="StatusText" Text="4 pages" Opacity="0.7" />
  23. </StackPanel>
  24. </ScrollViewer>
  25. <Border DockPanel.Dock="Right" Width="1"
  26. Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
  27. <Border Margin="12"
  28. BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
  29. BorderThickness="1"
  30. CornerRadius="6"
  31. ClipToBounds="True">
  32. <Panel x:Name="CarouselHost" />
  33. </Border>
  34. </DockPanel>
  35. </UserControl>