<userInterfaceElements:EvaWindow x:Class="Valg.EVA.Skanning.UserInterfaceElements.EmergencyMode.EmergencyModeConfigurationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:commands="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Commands"
        xmlns:emergencyMode1="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.EmergencyMode"
        xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements"
                                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:language="clr-namespace:Valg.EVA.Skanning.Resources.Language;assembly=Valg.EVA.Skanning.Resources"
             mc:Ignorable="d" 
             d:DataContext="{d:DesignInstance d:Type=emergencyMode1:EmergencyModeConfigurationWindowViewModel}"
        WindowStartupLocation="CenterOwner"
        ShowInTaskbar="False"
        Style="{DynamicResource PopUpWindowAction}"
        Title="{x:Static language:LanguageString.EmergencyMode_ConfgurationWindow_Title}"
        MinWidth="800"
        MaxWidth="800"
        MinHeight="650"
        MaxHeight="650"
        Icon="{Binding WindowIcon}">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Margin="30">
        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="*" />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="{x:Static language:LanguageString.EmergencyMode_ConfgurationWindow_Title}" HorizontalAlignment="Left" Style="{StaticResource TextBlockLargeHeader}" />

        <TabControl x:Name="wizardControl" Grid.Row="1" 
                    Background="White" BorderThickness="0" IsTabStop="False"
                    ItemsSource="{Binding ConfigureDetailsViewModels}"
                    SelectedItem="{Binding CurrentDetailViewModel}"
                    IsSynchronizedWithCurrentItem="True">
            <TabControl.Resources>
                <DataTemplate DataType="{x:Type emergencyMode1:SelectElectionEventViewModel}">
                    <emergencyMode1:SelectElectionEventView />
                </DataTemplate>
                <DataTemplate DataType="{x:Type emergencyMode1:SelectCountingAsViewModel}">
                    <emergencyMode1:SelectCountingAsView/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type emergencyMode1:SelectCountyViewModel}">
                    <emergencyMode1:SelectCountyView/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type emergencyMode1:SelectMunicipalityViewModel}">
                    <emergencyMode1:SelectMunicipalityView/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type emergencyMode1:CurrentValuesSummaryViewModel}">
                    <emergencyMode1:CurrentValuesSummaryView />
                </DataTemplate>
                <DataTemplate DataType="{x:Type emergencyMode1:ErrorViewModel}">
                    <emergencyMode1:ErrorView />
                </DataTemplate>
            </TabControl.Resources>
            <TabControl.ItemContainerStyle>
                <Style TargetType="TabItem">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Style>
            </TabControl.ItemContainerStyle>
        </TabControl>
        <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Height="49" MinWidth="115"
                    Content="{Binding Path=ConfigureDetailsViewModels/NextButtonText}"
                    IsDefault="True"
                    Style="{StaticResource BlueButtonNext}"
                    IsEnabled="{Binding Path=ConfigureDetailsViewModels/IsNextButtonEnabled}"
                    Command="{Binding AdvanceToNextStep}"
                    Visibility="{Binding ConfigureDetailsViewModels/IsNextButtonVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                    >

            </Button>
            <Button
            Margin="30,0,0,0"
            HorizontalAlignment="Right"
            Height="49"
            Style="{StaticResource RedButtonCancel}"
            Content="{Binding LanguageString.Button_Cancel, FallbackValue='Cancel'}"
            IsCancel="True"
            Command="{x:Static commands:WellKnownSystemCommands.CloseCommand}"
            CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
        </StackPanel>
    </Grid>
</userInterfaceElements:EvaWindow>
