mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-08 18:26:35 +08:00
* feat: add CarouselPage and PipsPager. * feat: add PipsPager control and integrate into index * feat: add PipsPagerDemo and integrate into MainView --------- Co-authored-by: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
100 lines
4.2 KiB
XML
100 lines
4.2 KiB
XML
<UserControl
|
|
x:Class="Semi.Avalonia.Demo.Pages.PipsPagerDemo"
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
d:DesignHeight="600"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d">
|
|
<ScrollViewer>
|
|
<StackPanel HorizontalAlignment="Left" Spacing="16" Margin="0,0,0,20">
|
|
|
|
<!-- Horizontal PipsPager -->
|
|
<TextBlock Classes="H6" Text="Horizontal" />
|
|
<PipsPager
|
|
NumberOfPages="8"
|
|
Orientation="Horizontal" />
|
|
|
|
<!-- Vertical PipsPager -->
|
|
<TextBlock Classes="H6" Text="Vertical" />
|
|
<PipsPager
|
|
NumberOfPages="8"
|
|
Orientation="Vertical" />
|
|
|
|
<!-- Linked with Carousel -->
|
|
<TextBlock Classes="H6" Text="Linked with Carousel" />
|
|
<Panel>
|
|
<Carousel
|
|
Name="DemoCarousel"
|
|
Height="160">
|
|
<Border Background="#EAF5FF">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#1C1F23"
|
|
Text="Page 1" />
|
|
</Border>
|
|
<Border Background="#F9F9F9">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#1C1F23"
|
|
Text="Page 2" />
|
|
</Border>
|
|
<Border Background="#FFF8EA">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#1C1F23"
|
|
Text="Page 3" />
|
|
</Border>
|
|
<Border Background="#FEF2ED">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#1C1F23"
|
|
Text="Page 4" />
|
|
</Border>
|
|
<Border Background="#F0F5FF">
|
|
<TextBlock
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Foreground="#1C1F23"
|
|
Text="Page 5" />
|
|
</Border>
|
|
</Carousel>
|
|
<ThemeVariantScope RequestedThemeVariant="Light">
|
|
<PipsPager
|
|
Name="LinkedPager"
|
|
NumberOfPages="5"
|
|
Orientation="Horizontal"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Bottom"
|
|
Margin="0,0,0,8"
|
|
SelectedPageIndex="{Binding #DemoCarousel.SelectedIndex}" />
|
|
</ThemeVariantScope>
|
|
</Panel>
|
|
|
|
<!-- Various page counts -->
|
|
<TextBlock Classes="H6" Text="Various Page Counts" />
|
|
<StackPanel Spacing="12">
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<TextBlock VerticalAlignment="Center" Width="80" Text="3 pages" />
|
|
<PipsPager NumberOfPages="3" Orientation="Horizontal" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<TextBlock VerticalAlignment="Center" Width="80" Text="5 pages" />
|
|
<PipsPager NumberOfPages="5" Orientation="Horizontal" />
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
<TextBlock VerticalAlignment="Center" Width="80" Text="10 pages" />
|
|
<PipsPager NumberOfPages="10" Orientation="Horizontal" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</UserControl>
|
|
|