<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Bili.App.Controls"
    xmlns:local="using:Bili.App.Controls.Community">
    <Style TargetType="local:PartitionItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PartitionItem">
                    <controls:CardPanel x:Name="RootCard">
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Grid
                                x:Name="ContentContainer"
                                Padding="8,0"
                                RowSpacing="8">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid
                                    Width="60"
                                    Height="60"
                                    Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
                                    CornerRadius="{StaticResource ControlCornerRadius}">
                                    <Image
                                        x:Name="PartitionLogo"
                                        Width="40"
                                        Height="40"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Source="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Image.Uri}"
                                        Stretch="Uniform" />
                                </Grid>
                                <TextBlock
                                    x:Name="PartitionName"
                                    Style="{StaticResource BodyTextBlockStyle}"
                                    Grid.Row="1"
                                    HorizontalAlignment="Center"
                                    MaxLines="1"
                                    Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Name}"
                                    TextAlignment="Center" />
                            </Grid>
                        </Grid>
                    </controls:CardPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="XboxPartitionItemStyle" TargetType="local:PartitionItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PartitionItem">
                    <controls:CardPanel x:Name="RootCard">
                        <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Grid
                                x:Name="ContentContainer"
                                Padding="8,0"
                                RowSpacing="8">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Grid
                                    Width="90"
                                    Height="90"
                                    Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"
                                    CornerRadius="{StaticResource ControlCornerRadius}">
                                    <Image
                                        x:Name="PartitionLogo"
                                        Width="72"
                                        Height="72"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Source="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Image.Uri}"
                                        Stretch="Uniform" />
                                </Grid>
                                <TextBlock
                                    x:Name="PartitionName"
                                    Style="{StaticResource BodyTextBlockStyle}"
                                    Grid.Row="1"
                                    HorizontalAlignment="Center"
                                    FontSize="16"
                                    MaxLines="1"
                                    Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Name}"
                                    TextAlignment="Center" />
                            </Grid>
                        </Grid>
                    </controls:CardPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
