<userInterfaceElements:EvaWindow x:Class="Valg.EVA.Skanning.UserInterfaceElements.EmergencyMode.EmergencyModeLoginWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        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:emergencyMode="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.EmergencyMode"
        mc:Ignorable="d" 
        d:DataContext="{d:DesignInstance d:Type=emergencyMode:EmergencyModeLoginViewModel}"
        WindowStartupLocation="CenterOwner"
        ShowInTaskbar="False"                                 
        Style="{DynamicResource PopUpWindowAction}"
        MaxWidth="800" 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="20">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Text="{Binding Title}" HorizontalAlignment="Left" Style="{StaticResource TextBlockLargeHeader}" />

        <TextBlock Grid.Row="1"
            Style="{StaticResource TextBlockNormal}"
            TextWrapping="Wrap"
            Text="{Binding Description1}" />
        <TextBlock Grid.Row="2"
            Margin="0,10,0,0"
            Style="{StaticResource TextBlockNormal}"
            TextWrapping="Wrap"
            Text="{Binding Description2}" />
        <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,20,0,0">
            <TextBlock
                Style="{StaticResource TextBlockMediumHeader}"
                Margin="0,0,10,0"
                VerticalAlignment="Center"
                Text="{Binding YourNameLabel}" />
            <TextBox
                userInterfaceElements:FocusExtension.IsFocused="True"
                Style="{StaticResource TextBoxNormal}"
                Width="400"
                VerticalAlignment="Center"
                Text="{Binding NameOfOperator, UpdateSourceTrigger=PropertyChanged}" />
        </StackPanel>
        <StackPanel Grid.Row="4" Margin="0,20,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            
            <Button IsDefault="True" 
            Height="49"
            HorizontalAlignment="Right"
            Style="{DynamicResource BlueButtonOk}"
            IsEnabled="{Binding IsLogonButtonEnabled}"
            Command="{Binding LogonCommand}"
            CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"
            Content="{Binding LogonButtonText}" />
            
            <Button
            Margin="20,00,0,0"
            HorizontalAlignment="Right"
            Style="{DynamicResource RedButtonCancel}"
            Content="{Binding LanguageString.Button_Cancel, FallbackValue=Avbryt}"
            IsCancel="True" />
        </StackPanel>
    </Grid>
</userInterfaceElements:EvaWindow>
