Skip to content

Commit

Permalink
修复Carousel控件无法铺满图片
Browse files Browse the repository at this point in the history
  • Loading branch information
ProJend committed Dec 30, 2024
1 parent 29ea6c7 commit b09ea72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
21 changes: 12 additions & 9 deletions src/BiliLite.UWP/Pages/Home/AnimePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,23 @@
<controls:Carousel
x:Name="control"
MaxHeight="240"
AspectRatio="3.49"
Background="AliceBlue"
AspectRatio="1.7"
ItemsSource="{x:Bind Path=m_viewModel.HomeData.Banners, Mode=OneWay}"
MaxItems="1"
SlideInterval="5000">
SlideInterval="0">
<controls:Carousel.ContentTemplate>
<DataTemplate>
<HyperlinkButton
Margin="4,0"
Padding="0"
Click="BannerItem_Click">
<Border>
<toolkit:ImageEx PlaceholderSource="ms-appx:///Assets/Thumbnails/Placeholde.png" Source="{Binding Path=Img, Converter={StaticResource imageConvert}, ConverterParameter='240h'}" />
</Border>
Margin="0,5,0,0"
Padding="5"
HorizontalAlignment="Stretch"
Click="BannerItem_Click"
CornerRadius="{ThemeResource OverlayCornerRadius}">
<toolkit:ImageEx
CornerRadius="{ThemeResource OverlayCornerRadius}"
PlaceholderSource="ms-appx:///Assets/Thumbnails/Placeholde.png"
Source="{Binding Path=Img, Converter={StaticResource imageConvert}, ConverterParameter='240h'}"
Stretch="Fill" />
</HyperlinkButton>
</DataTemplate>
</controls:Carousel.ContentTemplate>
Expand Down
9 changes: 6 additions & 3 deletions src/BiliLite.UWP/Pages/Home/RecommendPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,14 @@
<HyperlinkButton
Margin="0,5,0,0"
Padding="5"
HorizontalAlignment="Stretch"
Click="BannerItem_Click"
CornerRadius="{ThemeResource OverlayCornerRadius}">
<Border CornerRadius="{ThemeResource OverlayCornerRadius}">
<toolkit:ImageEx PlaceholderSource="ms-appx:///Assets/Thumbnails/Placeholde.png" Source="{x:Bind Path=Image, Converter={StaticResource imageConvert}, ConverterParameter='240h'}" />
</Border>
<toolkit:ImageEx
CornerRadius="{ThemeResource OverlayCornerRadius}"
PlaceholderSource="ms-appx:///Assets/Thumbnails/Placeholde.png"
Source="{x:Bind Path=Image, Converter={StaticResource imageConvert}, ConverterParameter='240h'}"
Stretch="Fill" />
</HyperlinkButton>
</DataTemplate>
</controls:Carousel.ContentTemplate>
Expand Down

0 comments on commit b09ea72

Please sign in to comment.