<Window x:Class="Valg.EVA.Skanning.Sample.Startup.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="EVA stikkprøve"
        WindowState="Maximized"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:startup="clr-namespace:Valg.EVA.Skanning.Sample.Startup"
        xmlns:ballot="clr-namespace:Valg.EVA.Skanning.Sample.Startup.Ballot"
        xmlns:registerBarcode="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.RegisterBarcode"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:topBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.TopBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:statusInformationBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.StatusInformationBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:converters="clr-namespace:Valg.EVA.Skanning.Sample.Startup.Converters"
        xmlns:roleSelector="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.RoleSelector;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:box="clr-namespace:Valg.EVA.Skanning.Sample.Startup.Box"
        xmlns:registerBarcode1="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.RegisterBarcode;assembly=Valg.EVA.Skanning.Scan.Presentation"
        mc:Ignorable="d"
        d:DesignWidth="1920"
        d:DesignHeight="1200"
        d:DataContext="{d:DesignInstance d:Type=startup:MainWindowViewModel}">
    <Window.Resources>
        <ResourceDictionary>
            <userInterfaceElements:ViewModelLocator x:Key="userInterfaceElementsLocator" />
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.Resources>
            <converters:BooleanToScrollBarVisibilityConverter x:Key="booleanToScrollBarVisibilityConverter" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <topBar:TopBar Grid.Row="0" DataContext="{Binding Source={StaticResource userInterfaceElementsLocator}, Path=TopBarViewModel}">
            <topBar:ChangeRoleButton
                DataContext="{Binding Source={StaticResource userInterfaceElementsLocator}, Path=ChangeRoleButtonViewModel}"
                Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter} }" />
        </topBar:TopBar>

        <DockPanel Grid.Row="1" LastChildFill="True">
            <TabControl IsTabStop="False" DockPanel.Dock="Top" Margin="50,0,50,0" SelectedIndex="{Binding CurrentMainViewIndex}" BorderThickness="0" Background="White" Padding="0,0,0,0">
                <TabControl.Items>
                    <TabItem>
                        <registerBarcode1:RegisterBarcodeControl HorizontalContentAlignment="Left" VerticalContentAlignment="Top" DataContext="{Binding RegisterBarcodeViewModel}" />
                    </TabItem>
                    <TabItem>
                        <box:BoxControl DataContext="{Binding BoxControlViewModel}"/>
                    </TabItem>
                    <TabItem>
                        <StackPanel Orientation="Horizontal">
                            <roleSelector:RoleSelectorView DataContext="{Binding Source={StaticResource userInterfaceElementsLocator}, Path=RoleSelectorViewModel}" />
                        </StackPanel>
                    </TabItem>
                </TabControl.Items>

                <TabControl.ItemContainerStyle>
                    <Style TargetType="TabItem">
                        <Setter Property="Visibility" Value="Collapsed" />
                    </Style>
                </TabControl.ItemContainerStyle>
            </TabControl>
            <StackPanel Visibility="Visible" DockPanel.Dock="Bottom" VerticalAlignment ="Bottom">
                <statusInformationBar:StatusInformationBarControl Margin="50,50,50,50" />
            </StackPanel>

        </DockPanel><Rectangle Grid.Row="0" Grid.RowSpan="2" Fill="Gray" Opacity=".5" Stretch="Fill" Visibility="{Binding LightBoxViewModel.LightBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</Window>
