| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- x:Class="ControlCatalog.Pages.CarouselPageDataTemplatePage">
- <DockPanel>
- <ScrollViewer DockPanel.Dock="Right" Width="240">
- <StackPanel Margin="12" Spacing="8">
- <TextBlock Text="Data Templates" FontWeight="SemiBold" FontSize="16"
- Foreground="{DynamicResource SystemControlHighlightAccentBrush}" />
- <TextBlock FontSize="12" Opacity="0.7" TextWrapping="Wrap"
- Text="Bind a CarouselPage to a view-model collection, render each item with PageTemplate, and switch templates at runtime." />
- <Separator />
- <Button Content="Add Page" Click="OnAddPage" HorizontalAlignment="Stretch" />
- <Button Content="Remove Last" Click="OnRemovePage" HorizontalAlignment="Stretch" />
- <Button Content="Switch Template" Click="OnSwitchTemplate" HorizontalAlignment="Stretch" />
- <Separator />
- <TextBlock Text="Navigate" FontWeight="SemiBold" FontSize="13" />
- <StackPanel Spacing="6">
- <Button Content="Previous" Click="OnPrevious" HorizontalAlignment="Stretch" />
- <Button Content="Next" Click="OnNext" HorizontalAlignment="Stretch" />
- </StackPanel>
- <Separator />
- <TextBlock x:Name="StatusText" Text="4 pages" Opacity="0.7" />
- </StackPanel>
- </ScrollViewer>
- <Border DockPanel.Dock="Right" Width="1"
- Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" />
- <Border Margin="12"
- BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}"
- BorderThickness="1"
- CornerRadius="6"
- ClipToBounds="True">
- <Panel x:Name="CarouselHost" />
- </Border>
- </DockPanel>
- </UserControl>
|