<Window x:Class="Valg.EVA.Skanning.UserInterfaceElements.Help.HelpView"
             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:help="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Help"
             xmlns:commands="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Commands"
             mc:Ignorable="d"
             Style="{DynamicResource PopUpWindowInformation}"
             d:DataContext="{d:DesignInstance d:Type=help:HelpViewModel}"
             d:DesignHeight="300"
             WindowStartupLocation="CenterOwner">
    <Window.InputBindings>
        <KeyBinding Key="Escape"
                    Command="{x:Static commands:WellKnownSystemCommands.CloseCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
    </Window.InputBindings>

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Margin="30" Width="Auto" Height="Auto">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <Image Margin="0,0,10,0"  VerticalAlignment="Center" Source="/Valg.EVA.Skanning.Assets;component/Images/ScanningLogo.png" />
            <TextBlock VerticalAlignment="Center" Style="{DynamicResource TextBlockLargeHeader}"  Text="{Binding LanguageString.Help_Title}" />
        </StackPanel>

        <StackPanel Grid.Row="1" Orientation="Vertical" Margin="0,20,0,20">
            <StackPanel.Resources>
                <Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockNormal}">
                    <Setter Property="Margin" Value="5"/>
                </Style>
                <Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockNormal}" x:Key="textLabel" >
                    <Setter Property="FontWeight" Value="Bold"/>
                    <Setter Property="Margin" Value="5"/>
                </Style>
            </StackPanel.Resources>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Button Grid.Row="0" Grid.ColumnSpan="2"
                    IsDefault="True"
                        Style="{DynamicResource LinkButtonNormal}"
                    Command="{Binding ShowExternalHelpCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
                    Content="{Binding LanguageString.Help_GoToExternalHelp, FallbackValue='Gå til hjelp'}"
                    Margin="0,0,0,30"></Button>

                <TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding ProductVersionLabel}" Style="{StaticResource textLabel}" />
                <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding ProductVersion}" />
                <TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding DatabaseVersionLabel}" Style="{StaticResource textLabel}" />
                <TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding DatabaseVersion}" />
                <TextBlock Grid.Column="0" Grid.Row="3" Text="{Binding ConfigurationVersionLabel}" Style="{StaticResource textLabel}" />
                <TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding ConfigurationVersion}" />
                <TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding ConfigurationMetadata}" />
                <TextBlock Grid.Column="0" Grid.Row="5" Text="{Binding BranchAndCommitLabel}" Style="{StaticResource textLabel}" />
                <TextBlock Grid.Column="1" Grid.Row="5" Text="{Binding BranchAndCommit}"/>
                <TextBlock Grid.Column="0" Grid.Row="6" Text="{Binding AdminLogonEnvironmentLabel}" Style="{StaticResource textLabel}" />
                <TextBlock Grid.Column="1" Grid.Row="6" Text="{Binding AdminLogonEnvironment}"/>
                <TextBlock Grid.Column="0" Grid.Row="7" 
                           Text="{Binding AdminTransferEnvironmentLabel}" 
                           Style="{StaticResource textLabel}" 
                           Visibility="{Binding ShowAdminTransferEnvironment, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                <TextBlock Grid.Column="1" Grid.Row="7" 
                           Text="{Binding AdminTransferEnvironment}"
                           Visibility="{Binding ShowAdminTransferEnvironment, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            </Grid>
        </StackPanel>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition MinWidth="50" Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Button Grid.Column="2"
                    IsCancel="True"
                    Style="{DynamicResource BlueButton}"
                    MinWidth="115"
                    Height="49"
                    VerticalAlignment="Center"
                    Command="{x:Static commands:WellKnownSystemCommands.CloseCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
                    Content="{Binding LanguageString.Button_Close, FallbackValue=Lukk}">
            </Button>
        </Grid>
    </Grid>
</Window>
