<UserControl x:Class="MyPad.Views.Regions.AboutContentView"
             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:i="http://schemas.microsoft.com/xaml/behaviors"
             xmlns:p="http://prismlibrary.com/"
             xmlns:m="http://metro.mahapps.com/winfx/xaml/controls"
             xmlns:mi="http://metro.mahapps.com/winfx/xaml/iconpacks"
             xmlns:le="http://wpflocalizeextension.codeplex.com"
             xmlns:qc="http://QuickConverter.CodePlex.com/"
             xmlns:ge="clr-namespace:SourceChord.GridExtra;assembly=GridExtra.Wpf"
             xmlns:root="clr-namespace:MyPad"
             xmlns:behaviors="clr-namespace:MyPad.Views.Behaviors"
             xmlns:controls="clr-namespace:MyPad.Views.Controls"
             xmlns:markup="clr-namespace:MyPad.Views.Markup"
             mc:Ignorable="d" 
             p:ViewModelLocator.AutoWireViewModel="True"
             d:DesignHeight="450" d:DesignWidth="800">

    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <i:InvokeCommandAction Command="{Binding LoadedHandler, Mode=OneTime}"/>
        </i:EventTrigger>
    </i:Interaction.Triggers>

    <Grid ge:GridEx.RowDefinition="Auto, 15, Auto, 15, *" Margin="0 -25 0 10" MaxWidth="{StaticResource Const.BreakPoint.XL}">
        <ScrollViewer Grid.Row="0" Margin="40 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Hidden">
            <Grid ge:GridEx.ColumnDefinition="Auto, 15, Auto, 15, Auto, 30, Auto, 15, Auto, 15, Auto">
                <Image     Grid.Column="0" Source="{markup:IconSource /Resources/app.ico}" Width="40" VerticalAlignment="Center"/>
                <TextBlock Grid.Column="2" Text="{Binding ProductInfo.Product, Mode=OneWay}" FontWeight="Bold" FontSize="32" Margin="0 0 0 5" VerticalAlignment="Center"/>
                <TextBlock Grid.Column="4" TextWrapping="Wrap" VerticalAlignment="Center" FontSize="14">
                    <Run Text="{qc:MultiBinding '\'Version \' + $P0.Major + \'.\' + $P0.Minor + \'.\' + $P0.Build + ($P1 ? \' - Debug Build\' : null)', P0={Binding ProductInfo.Version, Mode=OneWay}, P1={Binding ProductInfo.IsDebugBuild, Mode=OneWay}}"/>
                    <LineBreak/>
                    <Run Text="{Binding ProductInfo.Copyright, Mode=OneWay}"/>
                </TextBlock>
                <Button Grid.Column="6" Style="{StaticResource Common.CircleButton}" ToolTip="{le:Loc Command_Repository}" VerticalAlignment="Center" IsTabStop="False">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <behaviors:ProcessStartAction FileName="cmd.exe" Arguments="{qc:Binding '\'/c start \' + $P', P={Binding Source={x:Static root:AppSettingsReader.ProjectSite}, Mode=OneWay}}" CreateNoWindow="True" ThrowException="False"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <mi:Material Kind="Github"/>
                </Button>
                <Button Grid.Column="8" Style="{StaticResource Common.CircleButton}" ToolTip="{le:Loc Command_Creator}" VerticalAlignment="Center" IsTabStop="False">
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <behaviors:ProcessStartAction FileName="cmd.exe" Arguments="{qc:Binding '\'/c start \' + $P', P={Binding Source={x:Static root:AppSettingsReader.CreatorSite}, Mode=OneWay}}" CreateNoWindow="True" ThrowException="False"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <mi:Material Kind="FaceManProfile"/>
                </Button>
                <Button Grid.Column="10" Style="{StaticResource Common.CircleButton}" ToolTipService.ShowDuration="10000" VerticalAlignment="Center" IsTabStop="False">
                    <Button.ToolTip>
                        <StackPanel>
                            <TextBlock Text="{le:Loc Command_Donate}" FontSize="14"/>
                            <Border Height="5"/>
                            <TextBlock Text="{le:Loc Message_NotifyDonate}" Margin="5 0"/>
                        </StackPanel>
                    </Button.ToolTip>
                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="Click">
                            <behaviors:ProcessStartAction FileName="cmd.exe" Arguments="{qc:Binding '\'/c start \' + $P', P={Binding Source={x:Static root:AppSettingsReader.DonationSite}, Mode=OneWay}}" CreateNoWindow="True" ThrowException="False"/>
                        </i:EventTrigger>
                    </i:Interaction.Triggers>
                    <mi:Material Kind="Heart"/>
                </Button>
            </Grid>
        </ScrollViewer>

        <Border Grid.Row="2" Height="1" Margin="20 0" Background="{DynamicResource MahApps.Brushes.Gray2}"/>

        <m:FlipView Grid.Row="4" CircularNavigation="True" NavigationButtonsPosition="Outside" IsBannerEnabled="False" MouseHoverBorderEnabled="False">
            <controls:MarkdownViewer Markdown="{Binding History.Value, Mode=OneWay}"       IsTabStop="False"/>
            <controls:MarkdownViewer Markdown="{Binding Disclaimer.Value, Mode=OneWay}"    IsTabStop="False"/>
            <controls:MarkdownViewer Markdown="{Binding PrivacyPolicy.Value, Mode=OneWay}" IsTabStop="False"/>
            <controls:MarkdownViewer Markdown="{Binding OssLicense.Value, Mode=OneWay}"    IsTabStop="False"/>
        </m:FlipView>
    </Grid>
    
</UserControl>
