<UserControl x:Class="Valg.Eva.Skanning.Scan.Presentation.BoxInfo.BoxInfoControl"
             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:boxInfo="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.BoxInfo"
             xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             d:DataContext="{d:DesignInstance d:Type=boxInfo:BoxInfoViewModel}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="1"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        
        <StackPanel Grid.Column="0">
            <TextBlock Style="{StaticResource TextBlockLargeHeader}" Text="{Binding BoxRegisteredText}" Margin="0,0,0,50"/>
            <TextBlock Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" Text="{Binding Barcode1Text}"/>
            <TextBlock Style="{StaticResource TextBlockMediumHeader}" Text="{Binding Barcode1}"/>
            <TextBlock Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" Text="{Binding Barcode2Text}" Margin="0,30,0,0"/>
            <TextBlock Style="{StaticResource TextBlockMediumHeader}" Text="{Binding Barcode2}"/>
            <Button Style="{StaticResource LinkButtonNormal}" FontSize="16" Content="{Binding ReregisterBoxButtonText}" Margin="0,30,0,0"
                    Command="{Binding ReregisterBoxCommand}"/>
            <Button Style="{StaticResource LinkButtonNormal}" FontSize="16" Content="{Binding RegisterBoxAsEmptyText}" Margin="0,15,0,0"
                    Command="{Binding RegisterBoxAsEmptyCommand}"/>
        </StackPanel>

        <StackPanel Grid.Column="1" Margin="0,20,0,10">
            <Line X1="0" Y1="0" X2="0" Y2="2000" Stroke="Black" StrokeDashArray="1 1" StrokeThickness="1" ClipToBounds="False" />
        </StackPanel>
        
        <StackPanel Margin="20,0,0,0" Grid.Column="2">
            <TextBlock Style="{StaticResource TextBlockLargeHeader}" Text="{Binding BoxNumberAndCountHeaderText}" TextWrapping="WrapWithOverflow"  Margin="0,0,0,50"/>
            
            <Grid>
                <Grid.Resources>
                    <Style TargetType="TextBlock" BasedOn="{StaticResource TextBlockMediumHeader}">
                        <Setter Property="Margin" Value="0,0,0,15"/>
                        <Setter Property="TextWrapping" Value="WrapWithOverflow"/>
                    </Style>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding BoxElectionText}" />
                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding BoxElection}" />
                <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding BoxCountyText}" />
                <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding BoxCounty}" />
                <TextBlock Grid.Row="2" Grid.Column="0" Text="{Binding BoxMunicipalityText}" />
                <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding BoxMunicipality}" />
                <TextBlock Grid.Row="3" Grid.Column="0" Text="{Binding BoxPollingDistrictText}" />
                <TextBlock Grid.Row="3" Grid.Column="1" Text="{Binding BoxPollingDistrict}" />
                <TextBlock Grid.Row="4" Grid.Column="0" Text="{Binding BoxVotingCategoryText}" />
                <TextBlock Grid.Row="4" Grid.Column="1" Text="{Binding BoxCategory}" />
                <TextBlock Grid.Row="5" Grid.Column="0" Text="{Binding CountingText}"/>
                <TextBlock Grid.Row="5" Grid.Column="1" Text="{Binding Counting}"/>
            </Grid>
            
            <Button Margin="0,15,0,0" Style="{StaticResource BlueButtonNext}" Command="{Binding StartScanningCommand}" HorizontalAlignment="Left" VerticalContentAlignment="Center"
                    userInterfaceElements:FocusExtension.IsFocused="{Binding IsStartScanningButtonFocused}"
                    Content="{Binding StartScanningButtonText}"
                    Height="49">
            </Button>
        </StackPanel>
    </Grid>
</UserControl>

