feat: redesign CarouselDemo.

This commit is contained in:
Zhang Dian 2024-11-20 17:06:08 +08:00
parent 31e082f46e
commit 36d096d813

View File

@ -10,30 +10,24 @@
<UserControl.Styles> <UserControl.Styles>
<Style Selector="Carousel"> <Style Selector="Carousel">
<Setter Property="Height" Value="200" /> <Setter Property="Height" Value="200" />
<Style Selector="^ TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="#1C1F23" />
</Style>
</Style> </Style>
<Style Selector="TextBlock"> <Style Selector="RadioButton">
<Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="Theme" Value="{DynamicResource ButtonRadioButton}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="#1C1F23" />
</Style> </Style>
</UserControl.Styles> </UserControl.Styles>
<StackPanel Spacing="20"> <StackPanel Spacing="20">
<Carousel Theme="{DynamicResource FullCarousel}">
<Border Background="#EAF5FF">
<TextBlock Text="Text 1" />
</Border>
<Border Background="#F9F9F9">
<TextBlock Text="Text 2" />
</Border>
<Border Background="#FFF8EA">
<TextBlock Text="Text 3" />
</Border>
<Border Background="#FEF2ED">
<TextBlock Text="Text 4" />
</Border>
</Carousel>
<Carousel Theme="{DynamicResource FullCarousel}" <Carousel Theme="{DynamicResource FullCarousel}"
Classes="Line"> Classes.Dot="{Binding #DotButton.IsChecked}"
Classes.Columnar="{Binding #ColumnarButton.IsChecked}"
Classes.Line="{Binding #LineButton.IsChecked}"
Classes.Left="{Binding #LeftButton.IsChecked}"
Classes.Center="{Binding #CenterButton.IsChecked}"
Classes.Right="{Binding #RightButton.IsChecked}">
<Border Background="#EAF5FF"> <Border Background="#EAF5FF">
<TextBlock Text="Text 1" /> <TextBlock Text="Text 1" />
</Border> </Border>
@ -47,20 +41,39 @@
<TextBlock Text="Text 4" /> <TextBlock Text="Text 4" />
</Border> </Border>
</Carousel> </Carousel>
<Carousel Theme="{DynamicResource FullCarousel}" <StackPanel Orientation="Horizontal" Spacing="8">
Classes="Columnar Left"> <TextBlock VerticalAlignment="Center" Text="Type" />
<Border Background="#EAF5FF"> <Border Theme="{DynamicResource RadioButtonGroupBorder}">
<TextBlock Text="Text 1" /> <StackPanel Orientation="Horizontal">
<RadioButton
Name="DotButton"
IsChecked="True"
Content="Dot" />
<RadioButton
Name="ColumnarButton"
Content="Columnar" />
<RadioButton
Name="LineButton"
Content="Line" />
</StackPanel>
</Border> </Border>
<Border Background="#F9F9F9"> </StackPanel>
<TextBlock Text="Text 2" /> <StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock VerticalAlignment="Center" Text="Position" />
<Border Theme="{DynamicResource RadioButtonGroupBorder}">
<StackPanel Orientation="Horizontal">
<RadioButton
Name="LeftButton"
IsChecked="True"
Content="Left" />
<RadioButton
Name="CenterButton"
Content="Center" />
<RadioButton
Name="RightButton"
Content="Right" />
</StackPanel>
</Border> </Border>
<Border Background="#FFF8EA"> </StackPanel>
<TextBlock Text="Text 3" />
</Border>
<Border Background="#FEF2ED">
<TextBlock Text="Text 4" />
</Border>
</Carousel>
</StackPanel> </StackPanel>
</UserControl> </UserControl>