<Window x:Class="Valg.EVA.Skanning.JobManagement.Startup.MainWindow.MainWindow"
        x:Name="Window"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Icon="/Valg.EVA.Skanning.Assets;component/Images/Icons/EvaJobManagement.ico"
        WindowStartupLocation="CenterScreen"
        WindowState="Maximized"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:topBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.TopBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:spinner="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Spinner;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:roleSelector="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.RoleSelector;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:mainWindow="clr-namespace:Valg.EVA.Skanning.JobManagement.Startup.MainWindow"
        xmlns:statusInformationBar="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.StatusInformationBar;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:emergencyMode="clr-namespace:Valg.EVA.Skanning.JobManagement.Startup.EmergencyMode"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:ui1="clr-namespace:Valg.EVA.Skanning.JobManagement.Startup.UI"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:language="clr-namespace:Valg.EVA.Skanning.Resources.Language;assembly=Valg.EVA.Skanning.Resources"
        Title="{x:Static language:JobManagementLanguageString.Title_ApplicationName}"
        mc:Ignorable="d"
        d:DataContext="{d:DesignInstance d:Type=mainWindow:MainWindowViewModel}">
    <Window.InputBindings>
        <KeyBinding Key="F1" Command="{Binding ShowHelpCommand}"></KeyBinding>
    </Window.InputBindings>
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <DockPanel LastChildFill="True">

            <topBar:TopBar DataContext="{Binding Source={StaticResource Locator}, Path=TopBarViewModel}" DockPanel.Dock="Top">
                <StackPanel Orientation="Horizontal">
                    <topBar:ChangeRoleButton
                            DataContext="{Binding DataContext.ChangeRoleButtonViewModel, RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type mainWindow:MainWindow}}}"
                            Visibility="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter} }" />
                    <emergencyMode:ResetEmergencyModeLinkControl 
                        DataContext="{Binding DataContext.ResetEmergencyModeLinkViewModel, RelativeSource={ RelativeSource Mode=FindAncestor, AncestorType={x:Type mainWindow:MainWindow}}}"/>
                </StackPanel>
            </topBar:TopBar>

            <ScrollViewer CanContentScroll="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
                <i:Interaction.Behaviors>
                    <userInterfaceElements:BubbleScrollEvent />
                </i:Interaction.Behaviors>
                <DockPanel LastChildFill="True">                    
                    <TabControl DockPanel.Dock="Top"
                                SelectedIndex="{Binding CurrentMainViewIndex}"
                                BorderThickness="0"
                                Background="White"
                                Padding="0,30,0,0"
                                Margin="50,0,50,0"
                                IsTabStop="False">
                        <TabControl.Items>
                            <TabItem>
                                <ui1:MainView DataContext="{Binding JobManagementMainViewModel}" />
                            </TabItem>
                            <TabItem>
                                <StackPanel Orientation="Horizontal">
                                    <roleSelector:RoleSelectorView DataContext="{Binding RoleSelectorViewModel}" />
                                </StackPanel>
                            </TabItem>
                        </TabControl.Items>
                        <TabControl.ItemContainerStyle>
                            <Style TargetType="TabItem">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </Style>
                        </TabControl.ItemContainerStyle>
                    </TabControl>
                    <statusInformationBar:StatusInformationBarControl DockPanel.Dock="Bottom" Margin="50,50,50,50" />
                </DockPanel>
            </ScrollViewer>
        </DockPanel><Rectangle Fill="Gray" Opacity=".5" Stretch="Fill" Visibility="{Binding LightBoxViewModel.LightBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
        <spinner:SpinnerView Width="auto" Height="auto" HorizontalAlignment="Center" VerticalAlignment="Center" DataContext="{Binding SpinnerViewModel}" Visibility="{Binding SpinnerVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</Window>
