<Window x:Class="Valg.EVA.Skanning.Verify.Startup.VerifyWindow.VerifyWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding VerifyLanguageString.Title_ApplicationName}"
        WindowState="Maximized"
        Icon="/Valg.EVA.Skanning.Assets;component/Images/Icons/EvaVerify.ico"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:startPage="clr-namespace:Valg.EVA.Skanning.Verify.Startup.StartPage"        
        xmlns:verifyBallotPaper="clr-namespace:Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper"
        xmlns:boxComplete="clr-namespace:Valg.EVA.Skanning.Verify.Startup.BoxComplete"
        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:verifyWindow="clr-namespace:Valg.EVA.Skanning.Verify.Startup.VerifyWindow"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:roleSelector="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.RoleSelector;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:startup="clr-namespace:Valg.EVA.Skanning.Verify.Startup"
        xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
        xmlns:userInterfaceElements1="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
        xmlns:converters="clr-namespace:Valg.EVA.Skanning.Verify.Startup.Converters"
        mc:Ignorable="d"
        d:DesignWidth="1920"
        d:DesignHeight="1200"
        d:DataContext="{d:DesignInstance d:Type=verifyWindow:VerifyWindowViewModel}">
    <Window.InputBindings>
        <KeyBinding Key="F12" Command="{Binding BallotPaperContainerViewModel.NavigateBallotsViewModel.CurrentBallotPaperForVerify.VerifiableViewModelsCollectionVisitor.ResumeVisitationOfVerifiableViewModelsCommand}" />
        <KeyBinding Key="Left" Modifiers="Alt" Command="{Binding BallotPaperContainerViewModel.NavigateBallotsViewModel.CurrentBallotPaperForVerify.PageXOfYViewModel.AdvanceToPreviousPage}" />
        <KeyBinding Key="Right" Modifiers="Alt" Command="{Binding BallotPaperContainerViewModel.NavigateBallotsViewModel.CurrentBallotPaperForVerify.PageXOfYViewModel.AdvanceToNextPage}" />
        <KeyBinding Key="Up" Command="{Binding GiveMainControlsLastItemFocus}" />
        <KeyBinding Key="Down" Command="{Binding GiveMainControlsFirstItemFocus}" />
        <KeyBinding Key="F5" Command="{Binding RefreshCommand}" />
            <KeyBinding Key="F1" Command="{Binding ShowHelpCommand}"></KeyBinding>
    </Window.InputBindings>
    <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>
        <ScrollViewer Grid.Row="1"  CanContentScroll="True" VerticalScrollBarVisibility="{Binding IsFooterVisible, Converter={StaticResource booleanToScrollBarVisibilityConverter}}">
            <i:Interaction.Behaviors>
                <userInterfaceElements1:BubbleScrollEvent />
            </i:Interaction.Behaviors>
            <DockPanel LastChildFill="True">

            <StackPanel Visibility="{Binding IsFooterVisible, Converter={StaticResource BooleanToVisibilityConverter}}" DockPanel.Dock="Bottom">
                <statusInformationBar:StatusInformationBarControl Margin="50,50,50,50" />    
            </StackPanel>
            <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>
                        <startPage:VerifyStartPage DataContext="{Binding StartPageViewModel}" />
                    </TabItem>
                    <TabItem>
                        <verifyBallotPaper:VerificationOverviewControl DataContext="{Binding BallotPaperContainerViewModel}" Focusable="False" IsTabStop="False" Margin="0,0,0,20" />
                    </TabItem>
                    <TabItem>
                        <boxComplete:BoxCompleteView DataContext="{Binding BoxCompleteViewModel}" />
                    </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>
        </DockPanel>
        </ScrollViewer><Rectangle Grid.Row="0" Grid.RowSpan="2" Fill="Gray" Opacity=".5" Stretch="Fill" Visibility="{Binding LightBoxViewModel.LightBoxVisible, Converter={StaticResource BooleanToVisibilityConverter}}" />
    </Grid>
</Window>
