<UserControl
    x:Class="Bili.App.Controls.BannerView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:common="using:Bili.ViewModels.Interfaces.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:Bili.App.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="300"
    d:DesignWidth="400"
    mc:Ignorable="d">
    <Grid>
        <local:HorizontalRepeaterView Style="{x:Bind ViewStyle, Mode=OneWay}" ItemsSource="{x:Bind ItemsSource, Mode=OneWay}">
            <local:HorizontalRepeaterView.WideItemTemplate>
                <DataTemplate x:DataType="common:IBannerViewModel">
                    <local:BannerItem
                        Title="{x:Bind Description, Mode=OneWay}"
                        IsTooltipEnabled="{x:Bind IsTooltipEnabled}"
                        MinImageHeight="{x:Bind MinHeight, Mode=OneWay}"
                        Source="{x:Bind Cover, Mode=OneWay}"
                        TabFocusNavigation="Local"
                        Uri="{x:Bind Uri, Mode=OneWay}" />
                </DataTemplate>
            </local:HorizontalRepeaterView.WideItemTemplate>
            <local:HorizontalRepeaterView.NarrowItemTemplate>
                <DataTemplate x:DataType="common:IBannerViewModel">
                    <local:BannerItem
                        Title="{x:Bind Description, Mode=OneWay}"
                        IsTooltipEnabled="{x:Bind IsTooltipEnabled, Mode=OneWay}"
                        MaxImageHeight="999"
                        Source="{x:Bind Cover, Mode=OneWay}"
                        Uri="{x:Bind Uri, Mode=OneWay}">
                        <local:BannerItem.CardStyle>
                            <Style TargetType="local:CardPanel">
                                <Setter Property="IsEnableHoverAnimation" Value="False" />
                            </Style>
                        </local:BannerItem.CardStyle>
                    </local:BannerItem>
                </DataTemplate>
            </local:HorizontalRepeaterView.NarrowItemTemplate>
        </local:HorizontalRepeaterView>
    </Grid>
</UserControl>
