From fa8b2d1f2170dc778fe5ac3cfe5974d3c264214b Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:49:56 +0800 Subject: [PATCH] feat: enhance Carousel. --- .../Pages/CarouselDemo.axaml | 19 +- src/Semi.Avalonia/Controls/Carousel.axaml | 199 +++++++++++------- 2 files changed, 126 insertions(+), 92 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml index 6b419c0..ca93d4d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml @@ -8,7 +8,7 @@ d:DesignWidth="800" mc:Ignorable="d"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -25,22 +83,16 @@ - - + + - - - - - + - - + + + + - - - - - - - - - - - - - - + + + + + + + - + + + @@ -165,16 +209,14 @@ + ItemsSource="{TemplateBinding ItemCount, Mode=OneWay, Converter={StaticResource ItemsConverter}}" + SelectedIndex="{TemplateBinding SelectedIndex, Mode=TwoWay}"> @@ -185,30 +227,29 @@ Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" + Theme="{DynamicResource CarouselButton}" Margin="{DynamicResource CarouselButtonMargin}" - VerticalAlignment="Center" - Background="{DynamicResource CarouselButtonPointeroverForeground}" - BorderBrush="{DynamicResource CarouselButtonPressedForeground}" - Command="{Binding $parent[Carousel].Previous}" Foreground="{DynamicResource CarouselButtonForeground}" - Theme="{DynamicResource CarouselButton}" /> + Command="{Binding $parent[Carousel].Previous}" />