<ContentDialog
    x:Class="Bili.App.Controls.Dialogs.UpgradeDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:loc="using:Bili.App.Resources.Extension"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="{loc:Locale Name=HasUpdate}"
    Style="{StaticResource DefaultContentDialogStyle}"
    CloseButtonText="{loc:Locale Name=Cancel}"
    PrimaryButtonClick="ContentDialog_PrimaryButtonClickAsync"
    PrimaryButtonStyle="{StaticResource AccentButtonStyle}"
    PrimaryButtonText="{loc:Locale Name=OpenDownloadPage}"
    SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
    SecondaryButtonText="{loc:Locale Name=IgnoreVersion}"
    mc:Ignorable="d">

    <Grid RowSpacing="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Spacing="8">
            <TextBlock
                x:Name="TitleBlock"
                FontSize="18"
                FontWeight="Bold" />
            <Border
                x:Name="PreReleaseContainer"
                Padding="4"
                VerticalAlignment="Center"
                BorderBrush="{ThemeResource AccentFillColorDefaultBrush}"
                BorderThickness="1"
                CornerRadius="{StaticResource ControlCornerRadius}"
                Visibility="Collapsed">
                <TextBlock
                    FontSize="10"
                    Foreground="{ThemeResource AccentTextFillColorPrimaryBrush}"
                    Text="{loc:Locale Name=PreRelease}" />
            </Border>
        </StackPanel>

        <TextBlock
            x:Name="PublishTimeBlock"
            Style="{StaticResource CaptionTextBlockStyle}"
            Grid.Row="1"
            HorizontalAlignment="Left"
            Foreground="{ThemeResource TextFillColorSecondaryBrush}" />

        <ScrollViewer
            Grid.Row="2"
            MaxHeight="300"
            HorizontalScrollMode="Disabled"
            VerticalScrollBarVisibility="Hidden">
            <controls:MarkdownTextBlock
                x:Name="MarkdownBlock"
                Background="Transparent"
                FontSize="12"
                Header2FontSize="16"
                TextWrapping="Wrap" />
        </ScrollViewer>
    </Grid>
</ContentDialog>
