<UserControl x:Class="Valg.Eva.Skanning.Scan.Presentation.ScanInProgress.NotificationsDuringScanningControl"
             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:scanInProgress="clr-namespace:Valg.Eva.Skanning.Scan.Presentation.ScanInProgress"
             xmlns:userInterfaceElements="clr-namespace:Valg.EVA.Skanning.UserInterfaceElements;assembly=Valg.EVA.Skanning.UserInterfaceElements"
             mc:Ignorable="d"
             d:DesignHeight="300" d:DesignWidth="300"
             d:DataContext="{d:DesignInstance scanInProgress:INotificationDuringScanningViewModel}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.Resources>
            <DataTemplate DataType="{x:Type scanInProgress:NoPaperInFeederViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding NoPaperInScanner}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>
                    <TextBlock Margin="0,30,0,0" Text="{Binding PleasePutBallotsInTheInFeeder}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,30,0,0" Style="{StaticResource BlueButtonNext}" Height="49" Content="{Binding StartScanningAgain}" Command="{Binding StartScanningCommand}"
                            userInterfaceElements:FocusExtension.IsFocused="{Binding IsStartScanningButtonFocused}" />
                    <Button Margin="0,30,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Foreground="White" Content="{Binding DeleteAllBallotsInBoxAndCancel}" Command="{Binding DeleteAllBallotsAndCancelCommand}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate DataType="{x:Type scanInProgress:UnspecificReadsoftErrorViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding ProblemWithScanner}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>
                    <TextBlock Margin="0,30,0,0" Text="{Binding UnspecifiedErrorOccuredWhileScanning}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,10,0,0" Style="{StaticResource BlueButtonNext}" Height="49" Content="{Binding RestartAfterLastScannedBallot}" Command="{Binding RestartAfterLastScannedBallotCommand}"
                            userInterfaceElements:FocusExtension.IsFocused="{Binding IsRestartAfterLastScannedBallotButtonFocused}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49"
                            Visibility="{Binding HasScannedBallots, Converter={StaticResource BooleanToVisibilityConverter}}"
                            Content="{Binding DeleteAllBallotsInBoxAndRestart}" Command="{Binding DeleteAllAndRestartCommand}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Content="{Binding DeleteAllBallotsInBoxAndCancel}" Command="{Binding DeleteAllAndCancelCommand}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate DataType="{x:Type scanInProgress:PaperJamViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding ProblemWithScanner}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>
                    <TextBlock Margin="0,30,0,0" Text="{Binding LastScannedAndRegisteredBallotIsShownToTheRight}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <TextBlock Margin="0,30,0,0" Text="{Binding PleaseVerifyThatThePaperFeederMechanismIsWorking}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,10,0,0" Style="{StaticResource BlueButtonNext}" Height="49" Content="{Binding RestartAfterLastScannedBallot}" Command="{Binding RestartAfterLastScannedBallotCommand}" userInterfaceElements:FocusExtension.IsFocused="{Binding IsRestartAfterLastScannedBallotButtonFocused}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Content="{Binding DeleteAllBallotsInBoxAndRestart}" Command="{Binding DeleteAllAndRestartCommand}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Content="{Binding DeleteAllBallotsIsBoxAndCancel}" Command="{Binding DeleteAllAndCancelCommand}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate DataType="{x:Type scanInProgress:SaveDataFailedViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding CouldNotSaveTitle}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>
                    <TextBlock Margin="0,30,0,0" Text="{Binding LastScannedAndRegisteredBallotIsShownToTheRightText}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <TextBlock Margin="0,30,0,0" Text="{Binding DatabaseIsDownSolutionText}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,10,0,0" Style="{StaticResource BlueButtonNext}" Height="49" Content="{Binding RestartAfterLastScannedBallotText}" Command="{Binding RestartAfterLastScannedBallotCommand}" userInterfaceElements:FocusExtension.IsFocused="{Binding IsRestartAfterLastScannedBallotButtonFocused}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Content="{Binding DeleteAllBallotsInBoxAndRestartText}" Command="{Binding DeleteAllAndRestartCommand}" />
                    <Button Margin="0,10,0,0" Style="{StaticResource RedButtonCancel}" Height="49" Content="{Binding DeleteAllBallotsIsBoxAndCancelText}" Command="{Binding DeleteAllAndCancelCommand}" />
                </StackPanel>
            </DataTemplate>
            <DataTemplate DataType="{x:Type scanInProgress:BoxIsDeletedDuringScanViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding Title}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>                    
                    <TextBlock Margin="0,30,0,0" Text="{Binding InformationText}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,30,0,0" 
                            Style="{StaticResource BlueButtonNext}" 
                            Content="{Binding StartNewScannText}" 
                            Command="{Binding StartNewScannCommand}" 
                            Height="49px"
                            HorizontalAlignment="Left"
                            userInterfaceElements:FocusExtension.IsFocused="{Binding IsButtonFocused}" />                    
                </StackPanel>
            </DataTemplate>
            <DataTemplate DataType="{x:Type scanInProgress:BatchInUseForJobViewModel}">
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="0,0,10,0" Style="{StaticResource WarningIcon}" FontSize="36" Foreground="{StaticResource Warning}" />
                        <TextBlock Text="{Binding ProblemWithJobUsingBatch}" Style="{StaticResource TextBlockLargeHeader}" />
                    </StackPanel>
                    <TextBlock Margin="0,30,0,0" Text="{Binding ProblemWithJobUsingBatchSolution}" Style="{StaticResource TextBlockMediumHeader}" FontWeight="Bold" TextWrapping="WrapWithOverflow" />
                    <Button Margin="0,30,0,0" 
                            Style="{StaticResource RedButtonCancel}" Height="49"
                            Content="{Binding DeleteAllBallotsIsBoxAndCancel}" 
                            Command="{Binding DeleteAllAndCancelCommand}" 
                            userInterfaceElements:FocusExtension.IsFocused="{Binding IsDeleteAllAndCancelButtonFocused}"/>
                </StackPanel>
            </DataTemplate>
        </Grid.Resources>

        <Border BorderBrush="{StaticResource Warning}" BorderThickness="8px" Padding="20">
            <ContentPresenter Content="{Binding}" />
        </Border>
    </Grid>
</UserControl>
