feat: Add FullCarousel theme.

This commit is contained in:
rabbitism
2023-02-05 22:30:01 +08:00
parent 2b0c26660e
commit 08f8ccd215
8 changed files with 260 additions and 34 deletions

View File

@@ -7,31 +7,49 @@
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="Border">
<Setter Property="Height" Value="200" />
</Style>
<Style Selector="TextBlock">
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</UserControl.Styles>
<StackPanel Spacing="20">
<TextBlock Classes="Strong" Text="This is still WIP" />
<Grid
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
ColumnDefinitions="Auto, *, Auto">
<RepeatButton
Name="Previous"
Grid.Column="0"
Content="Previous" />
<Carousel Name="carousel" Grid.Column="1">
<Carousel.PageTransition>
<PageSlide Orientation="Horizontal" Duration="0.25" />
</Carousel.PageTransition>
<Carousel Theme="{DynamicResource FullCarousel}">
<Carousel.PageTransition>
<PageSlide Orientation="Horizontal" Duration="0.25" />
</Carousel.PageTransition>
<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" />
</Carousel>
<RepeatButton
Name="Next"
Grid.Column="2"
Content="Next" />
</Grid>
<TextBlock Text="{Binding #carousel.SelectedIndex}" />
</Border>
</Carousel>
<Carousel Classes="Line" Theme="{DynamicResource FullCarousel}">
<Carousel.PageTransition>
<PageSlide Orientation="Horizontal" Duration="0.25" />
</Carousel.PageTransition>
<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>
</StackPanel>
</UserControl>

View File

@@ -10,17 +10,5 @@ public partial class CarouselDemo : UserControl
public CarouselDemo()
{
InitializeComponent();
Previous.Click += OnPreviousClick;
Next.Click += OnNextClick;
}
private void OnPreviousClick(object sender, RoutedEventArgs args)
{
carousel.Previous();
}
private void OnNextClick(object sender, RoutedEventArgs args)
{
carousel.Next();
}
}