<UserControl x:Class="Hearthstone_Deck_Tracker.FlyoutControls.UpdateNotes"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:flyoutControls="clr-namespace:Hearthstone_Deck_Tracker.FlyoutControls"
             xmlns:xaml="clr-namespace:Hearthstone_Deck_Tracker.Utility.Markdown.Xaml"
             DataContext="{Binding RelativeSource={RelativeSource Self}}"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="600">
    <UserControl.Resources>
        <Style TargetType="FlowDocument" x:Key="DocumentStyle">
            <Setter Property="FontFamily"
                    Value="Calibri" />
            <Setter Property="TextAlignment"
                    Value="Left" />
        </Style>

        <Style x:Key="PageHeader"
               TargetType="Paragraph">
            <Setter Property="FontSize"
                    Value="42" />
            <Setter Property="Foreground"
                    Value="White" />
            <Setter Property="FontWeight"
                    Value="Light" />
        </Style>

        <Style x:Key="SubHeader"
               TargetType="Paragraph">
            <Setter Property="FontSize"
                    Value="20" />
            <Setter Property="Foreground"
                    Value="White" />
            <Setter Property="FontWeight"
                    Value="Light" />
        </Style>

        <Style x:Key="SubHeaderSecondary"
               TargetType="Paragraph">
            <Setter Property="FontSize"
                    Value="20" />
            <Setter Property="Foreground"
                    Value="White" />
            <Setter Property="FontWeight"
                    Value="Light" />
        </Style>

        <xaml:Markdown x:Key="Markdown"
                        DocumentStyle="{StaticResource DocumentStyle}"
                        Heading1Style="{StaticResource PageHeader}"
                        Heading2Style="{StaticResource SubHeader}"
                        Heading3Style="{StaticResource SubHeaderSecondary}"/>

        <xaml:TextToFlowDocumentConverter x:Key="TextToFlowDocumentConverter" 
                                           Markdown="{StaticResource Markdown}"/>
    </UserControl.Resources>
    <Grid>
        <DockPanel Visibility="{Binding ShowHighlight, Converter={StaticResource InverseBoolToVisibility}}">
            <GroupBox DockPanel.Dock="Bottom" Header="Continue...">
                <StackPanel Margin="5">
                    <TextBlock Text="Want to support the development of Hearthstone Deck Tracker and our other projects? You can now subscribe to our premium service on HSReplay.net! (We also have a ton of new and completely free features there!)" 
                                Margin="10,5,10,10" FontWeight="SemiBold" TextWrapping="Wrap" HorizontalAlignment="Center"/>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                        <Button Name="ButtonHSReplaynet" Width="160" Height="30" Margin="10,0,0,0" Style="{DynamicResource AccentedSquareButtonStyle}" Click="ButtonHSReplaynet_Click">
                            <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="/HearthstoneDeckTracker;component/Resources/hsreplay_logo_white.png" Width="18" RenderOptions.BitmapScalingMode="Fant"/>
                                    <TextBlock Margin="3,0,0,0" Text="HSReplay.net" VerticalAlignment="Center"/>
                                </StackPanel>
                            </Button.Content>
                        </Button>
                        <Button Name="ButtonClose" Width="160" Height="30"  Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" Click="ButtonClose_Click">
                            <TextBlock Text="Continue"/>
                        </Button>
                    </StackPanel>
                </StackPanel>
            </GroupBox>
            <Border BorderThickness="1" BorderBrush="{DynamicResource AccentColorBrush}" Margin="5">
                <FlowDocumentScrollViewer Document="{Binding ReleaseNotes, RelativeSource={RelativeSource AncestorType=flyoutControls:UpdateNotes}, Converter={StaticResource TextToFlowDocumentConverter}}"
                                          Margin="5" />
            </Border>
        </DockPanel>
        <DockPanel Visibility="{Binding ShowHighlight, Converter={StaticResource BoolToVisibility}}">
            <Button Name="ButtonContinue" DockPanel.Dock="Bottom" MinWidth="180" HorizontalAlignment="Center" Margin="5" Style="{DynamicResource AccentedSquareButtonStyle}" Click="ButtonContinue_OnClick">
                <TextBlock>Continue to Update Notes</TextBlock>
            </Button>
            <ScrollViewer VerticalScrollBarVisibility="Auto">
                <ContentControl Name="ContentControlHighlight"/>
            </ScrollViewer>
        </DockPanel>
    </Grid>
</UserControl>
