<Controls:MetroWindow x:Name="splashWindow"
                      x:Class="Vulnerator.View.UI.SplashWindow"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      xmlns:Converters="clr-namespace:Vulnerator.View.Converter"
                      xmlns:IconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
                      xmlns:local="clr-namespace:Vulnerator.View.UI"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      Title="Vulnerator"
                      BorderBrush="{DynamicResource AccentColorBrush}"
                      DataContext="{Binding Splash, Source={StaticResource Locator}}"
                      GlowBrush="{DynamicResource AccentColorBrush}"
                      Icon="/Vulnerator;component/Resources/vulnerator.ico"
                      ResizeMode="NoResize"
                      ShowCloseButton="False"
                      ShowMaxRestoreButton="False"
                      ShowMinButton="False"
                      SizeToContent="WidthAndHeight"
                      Style="{DynamicResource CustomCleanWindowStyleKey}"
                      WindowStartupLocation="CenterScreen"
                      mc:Ignorable="d">

    <!--  Window Icon Template  -->
    <Controls:MetroWindow.IconTemplate>
        <DataTemplate>
            <Border Width="48">
                <IconPacks:PackIconFontAwesomeBrands Width="{TemplateBinding Width}"
                                                     Height="{TemplateBinding Height}"
                                                     Margin="4"
                                                     HorizontalAlignment="Center"
                                                     Flip="Horizontal"
                                                     Foreground="{DynamicResource BlackBrush}"
                                                     Kind="Vulnerator" />
            </Border>
        </DataTemplate>
    </Controls:MetroWindow.IconTemplate>

    <!--  Window Titlebar Controls  -->
    <Controls:MetroWindow.TitleTemplate>
        <DataTemplate>
            <StackPanel HorizontalAlignment="Left"
                        Orientation="Horizontal">
                <TextBlock Margin="5,0"
                           VerticalAlignment="Center"
                           FontFamily="{DynamicResource HeaderFontFamily}"
                           FontSize="{DynamicResource WindowTitleFontSize}"
                           Text="{TemplateBinding Content}"
                           TextTrimming="CharacterEllipsis" />
            </StackPanel>
        </DataTemplate>
    </Controls:MetroWindow.TitleTemplate>

    <!--  Window Command Button Styling  -->
    <Controls:MetroWindow.WindowButtonCommands>
        <Controls:WindowButtonCommands Template="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
    </Controls:MetroWindow.WindowButtonCommands>

    <Controls:MetroWindow.Resources>
        <Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </Controls:MetroWindow.Resources>

    <StackPanel Margin="5,0"
                HorizontalAlignment="Center">
        <Label HorizontalAlignment="Center"
               Style="{StaticResource TopLevelHeaderStyle}">
            <TextBlock Text="Welcome!"
                       TextTrimming="CharacterEllipsis" />
        </Label>
        <TextBlock MaxWidth="300"
                   Margin="5,0"
                   Text="Thank you for using Vulnerator - before the application can be utilized, there is some basic information required"
                   TextWrapping="Wrap" />
        <Label HorizontalAlignment="Left"
               Style="{StaticResource SecondLevelHeaderStyle}">
            <TextBlock Text="Application Environment"
                       TextTrimming="CharacterEllipsis" />
        </Label>
        <RadioButton x:Name="portable"
                     Margin="5,0,5,5"
                     HorizontalAlignment="Left"
                     GroupName="environment"
                     IsChecked="{Binding IsPortable}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Portable" />
                <Rectangle Width="10"
                           Height="10"
                           Margin="5,0"
                           VerticalAlignment="Center"
                           Fill="{DynamicResource AccentColorBrush}"
                           ToolTip="All support files will be installed into the Vulnerator folder (minimal footprint)">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{IconPacks:FontAwesomeLight Kind=InfoCircle}" />
                    </Rectangle.OpacityMask>
                </Rectangle>
            </StackPanel>
        </RadioButton>
        <RadioButton x:Name="persistant"
                     Margin="5,0,5,5"
                     HorizontalAlignment="Left"
                     GroupName="environment"
                     IsChecked="{Binding IsPersistent}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Persistant" />
                <Rectangle Width="10"
                           Height="10"
                           Margin="5,0"
                           VerticalAlignment="Center"
                           Fill="{DynamicResource AccentColorBrush}"
                           ToolTip="Log files will be generated in the LocalData folder, and the user (you) gets to decide where the application database goes (perfect for sharing)">
                    <Rectangle.OpacityMask>
                        <VisualBrush Visual="{IconPacks:FontAwesomeLight Kind=InfoCircle}" />
                    </Rectangle.OpacityMask>
                </Rectangle>
            </StackPanel>
        </RadioButton>
        <Label HorizontalAlignment="Left"
               Style="{StaticResource SecondLevelHeaderStyle}"
               Visibility="{Binding IsChecked, ElementName=persistant, Converter={StaticResource BooleanToVisibilityConverter}}">
            <TextBlock Text="Application Database Location"
                       TextTrimming="CharacterEllipsis" />
        </Label>
        <Grid MaxWidth="300"
              Visibility="{Binding IsChecked, ElementName=persistant, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Border Margin="5,0,0,5"
                    BorderBrush="{DynamicResource TextBoxBorderBrush}"
                    BorderThickness="1">
                <TextBlock Padding="3"
                           VerticalAlignment="Center"
                           Text="{Binding DatabasePath}"
                           TextTrimming="CharacterEllipsis"
                           ToolTip="{Binding DatabasePath}" />
            </Border>
            <Button Grid.Column="1"
                    Margin="5,0,5,5"
                    Command="{Binding BrowseForDatabaseCommand}"
                    Content="{IconPacks:FontAwesomeLight Kind=FileSearch}"
                    ToolTip="Select" />
            <Button Grid.Column="2"
                    Margin="0,0,5,5"
                    Command="{Binding CreateDatabaseCommand}"
                    Content="{IconPacks:FontAwesomeLight Kind=FilePlus}"
                    ToolTip="Create" />
        </Grid>
        <Button Margin="5,0,5,5"
                HorizontalAlignment="Center"
                Command="{Binding LaunchCommand}"
                CommandParameter="{Binding ElementName=splashWindow}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="Launch" />
                <IconPacks:PackIconFontAwesomeLight Height="12"
                                                    Margin="2,0,0,0"
                                                    VerticalAlignment="Center"
                                                    Kind="SignInAlt" />
            </StackPanel>
        </Button>
        <TextBox MaxWidth="300"
                 Margin="5,0,5,5"
                 Background="LightPink"
                 Style="{StaticResource ErrorTextBox}"
                 Text="{Binding ErrorText}"
                 TextAlignment="Center"
                 TextWrapping="Wrap"
                 Visibility="{Binding ErrorVisibility}" />
    </StackPanel>
</Controls:MetroWindow>
