<Window x:Class="Valg.Eva.Skanning.Scan.Presentation.MainWindow.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding ScanLanguageString.Title_ApplicationName}" 
        WindowState="Maximized"
        Icon="/Valg.EVA.Skanning.Assets;component/Images/Icons/EvaScan.ico"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:statusInformationBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.StatusInformationBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:topBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.TopBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:mainWindow="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.MainWindow"
        xmlns:registerBarcode="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.RegisterBarcode"
        xmlns:scannerQualityTest="clr-namespace:Valg.EVA.Skanning.Scan.Presentation.ScannerQuality"
        xmlns:boxInfo="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.BoxInfo"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:scanInProgress="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.ScanInProgress"
        xmlns:spinner="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Spinner;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        mc:Ignorable="d"
        d:DesignWidth="1920"
        d:DesignHeight="1200"
        d:DataContext="{d:DesignInstance mainWindow:MainWindowViewModel}">

    <Window.InputBindings>
        <KeyBinding Key="F1" Command="{Binding ShowHelpCommand}"></KeyBinding>
    </Window.InputBindings>
    <Window.Resources>
        <ResourceDictionary>
            <userInterfaceElements:ViewModelLocator x:Key="Locator" />
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <DockPanel LastChildFill="True">

            <Grid DockPanel.Dock="Top" Margin="0,0,0,10">
                <topBar:TopBar DataContext="{Binding Source={StaticResource Locator}, Path=TopBarViewModel}" >
                    <StackPanel Orientation="Horizontal">
                        <Button Content="{Binding LanguageString.Label_ScannerQuality, FallbackValue='Check scanner quality'}" Command="{Binding Path=ShowScannerQualityCommand}" 
                                        Visibility="Collapsed"
                                        IsTabStop="False" />
                    </StackPanel>
                </topBar:TopBar>
            </Grid>

            <statusInformationBar:StatusInformationBarControl DockPanel.Dock="Bottom" Margin="50,0,50,50"/>

            <TabControl  SelectedIndex="{Binding CurrentMainViewIndex}" IsTabStop="False" Margin="50,0,50,0"  BorderThickness="0" Background="White" Padding="0,0,0,0">
                <TabControl.Items>
                    <TabItem>
                        <registerBarcode:RegisterBarcodeControl HorizontalContentAlignment="Left" VerticalContentAlignment="Top" DataContext="{Binding RegisterBarcodeViewModel}" />
                    </TabItem>
                    <TabItem>
                        <boxInfo:BoxInfoControl DataContext="{Binding BoxInfoViewModel}"/>
                    </TabItem>
                    <TabItem>
                        <scanInProgress:ScanInProgressControl DataContext="{Binding ScanInProgressViewModel}" />
                    </TabItem>
                    <TabItem>
                        <scannerQualityTest:ScannerQualityControl HorizontalContentAlignment="Left" VerticalContentAlignment="Top" DataContext="{Binding ScannerQualityViewModel}" />
                    </TabItem>
                </TabControl.Items>

                <TabControl.ItemContainerStyle>
                    <Style TargetType="TabItem">
                        <Setter Property="Visibility" Value="Collapsed" />
                    </Style>
                </TabControl.ItemContainerStyle>
            </TabControl>

        </DockPanel>

        <Rectangle Fill="Gray" Opacity=".5" Stretch="Fill" Visibility="{Binding LightBoxViewModel.LightBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" Margin="-10,31,10.333,-31.333" />
        <spinner:SpinnerView Width="auto" Height="auto" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding SpinnerViewModel}" Visibility="{Binding SpinnerVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</Window>

