<userInterfaceElements:EvaWindow x:Class="Valg.EVA.Skanning.UserInterfaceElements.Welcome.WelcomeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:commands="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Commands"
             xmlns:welcome="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements.Welcome"
             xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements"
             mc:Ignorable="d"
             d:DataContext="{d:DesignInstance d:Type=welcome:WelcomeViewModel}"
             Style="{DynamicResource PopUpWindowInformation}"
             WindowStartupLocation="CenterScreen"
             ShowInTaskbar="False"
             MinHeight="650" MinWidth="800"
             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="400"></RowDefinition>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="100"></RowDefinition>
            <RowDefinition Height="49"></RowDefinition>
        </Grid.RowDefinitions>
        <Image Grid.Row="0"
               Source="{Binding WelcomeImage}"
               Stretch="None" />
        <StackPanel Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal">
            <Button
                Style="{DynamicResource BlueButton}"
                Height="50"
                IsDefault="True"
                Content="{Binding ScanLanguageString.Button_Login, FallbackValue=Logg inn med Id-porten}"
                Command="{Binding StartIdPortenLoginCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
        </StackPanel>

        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button VerticalAlignment="Center"
                    Margin="0,0,0,0"
                    Style="{DynamicResource LinkButtonMedium }"
                    Content="{Binding LanguageString.InstallClientCertificate_ButtonText, FallbackValue='Install client certificate'}"
                    Command="{Binding StartInstallClientCertificateCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
            <Button VerticalAlignment="Center"
                    Visibility="{Binding ShowEmergencyModeConfiguration, Converter={StaticResource BooleanToVisibilityConverter}}"
                    Margin="30,0,0,0"
                    Style="{DynamicResource LinkButtonMedium }"
                    Content="{Binding LanguageString.EmergencyMode_StartEmergencyModeConfguration_ButtonText, FallbackValue='Start emergency mode configuration'}"
                    Command="{Binding StartEmergencyModeConfigurationCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
            <Button VerticalAlignment="Center"
                    HorizontalAlignment="Center"
                    Visibility="{Binding ShowEmergencyModeLogin, Converter={StaticResource BooleanToVisibilityConverter}}"
                    Margin="30,0,0,0"
                    Style="{DynamicResource LinkButtonMedium }"
                    Content="{Binding LanguageString.EmergencyMode_EmergencyModeLogin_ButtonText, FallbackValue='Emergency mode login'}"
                    Command="{Binding StartEmergencyModeLoginCommand}"
                    CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
        </StackPanel>
        <Button Grid.Row="4"
                    Height="49"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"
                    Style="{DynamicResource RedButtonCancel}"
                    Content="{Binding ScanLanguageString.Exit}"
                    IsCancel="True"
                    Command="{Binding Quit}" />
    </Grid>
</userInterfaceElements:EvaWindow>
