<userInterfaceElements:EvaWindow x:Class="Valg.EVA.Skanning.JobManagement.Startup.UI.Counting.GenerateBarcodesView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:counting="clr-namespace:Valg.EVA.Skanning.JobManagement.Startup.UI.Counting"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        mc:Ignorable="d"
        Style="{DynamicResource PopUpWindowAction}"
        WindowStartupLocation="CenterOwner" 
        ShowInTaskbar="False"   
        d:DataContext="{d:DesignInstance d:Type=counting:GenerateBarcodesViewModel}" Loaded="EvaWindow_Loaded" 
                                 >
    <Window.Resources>
        <ResourceDictionary>
            <Style TargetType="Button" BasedOn="{StaticResource LinkButtonNormal}">
                <Setter Property="Margin" Value="0,0,0,5" />
            </Style>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Margin="30" Height="500" Width="600">
        <Grid.RowDefinitions>
            <RowDefinition Height="4*" />
            <RowDefinition Height="3*" />
            <RowDefinition Height="2*" />
            <RowDefinition Height="12*" />
            <RowDefinition Height="3*" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text= "{Binding JobManagementLanguageString.GenerateBarcodesViewTitle}" Style="{StaticResource TextBlockLargeHeader}" HorizontalAlignment="Center"/>
        <StackPanel Grid.Row="1" Orientation="Horizontal" Height="60" Margin="0,5,0,0">
            <Border BorderBrush="{x:Null}" Height="50">
                <TextBlock Text="{Binding JobManagementLanguageString.GenerateBarcodesViewNumberOfBoxes}" Style="{StaticResource TextBlockLarge}" VerticalAlignment="Center" Margin="5,0,5,0"/>
            </Border>
            <TextBox Name="txtNumberOfBoxes" TabIndex="0" Text="{Binding NumberOfBoxes, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="49" Width="50" Style="{StaticResource TextBoxNormal}" VerticalContentAlignment="Center" Padding="5,0,5,0" >
                <TextBox.InputBindings>
                    <KeyBinding Key="Enter" Command="{Binding GenerateBarcodesCommand }"/>
                </TextBox.InputBindings>
            </TextBox>
            <Button Content="{Binding JobManagementLanguageString.GenerateBarcodesViewGenerate}" Height="49" Width="200" Style="{StaticResource BlueButtonNext}" Command="{Binding GenerateBarcodesCommand}" HorizontalAlignment="Right" IsDefault="True"/>
        </StackPanel>
        <TextBlock Grid.Row="2" Text= "{Binding JobManagementLanguageString.GenerateBarcodesListClickHint, TargetNullValue='Hestehoste'}" 
                       Visibility="{Binding Path=HasBarcodes, Converter={StaticResource BooleanToVisibilityConverter} }"></TextBlock>
        <ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
            <ItemsControl ItemsSource="{Binding BarcodeItems}" Margin="0,5,0,5" >
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Button Content="{Binding Code1}" Style="{StaticResource BlueButtonResolveDuplicates}" Command="{Binding CopyCode1Command}" CommandParameter="{Binding }" Margin="0, 2, 30, 0" />
                            <Button Content="{Binding Code2}" Style="{StaticResource BlueButtonResolveDuplicates}" Command="{Binding CopyCode2Command}" CommandParameter="{Binding }" Margin="0,2,0,0"/>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </ScrollViewer>
        <Button Grid.Row="4" Content="{Binding LanguageString.Button_Close}" Style="{StaticResource BlueButton}" Height="49" Width="200" Click="OnCloseWindow" HorizontalAlignment ="Right" Margin="0,5" IsCancel="True"/>
    </Grid>
</userInterfaceElements:EvaWindow>
