<Window x:Class="Valg.EVA.Skanning.EncryptedConnectionStringConfiguration.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Valg.EVA.Skanning.EncryptedConnectionStringConfiguration"
        d:DataContext="{d:DesignInstance d:Type=local:MainWindowViewModel}"
        mc:Ignorable="d"
        Style="{DynamicResource PopUpWindowAction}"
        Title="Databasekonfigurasjon" Height="350" Width="500" WindowStartupLocation="CenterScreen" WindowState="Normal" Topmost="True">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Valg.EVA.Skanning.Assets;component/ResourceDictionaries/ResourceLibrary.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <StackPanel Margin="20">
        <Image Grid.Row="0" Stretch="None" Source="/Valg.EVA.Skanning.Assets;component/Images/ElectionLogo.png" HorizontalAlignment="Center"/>
        <TextBlock Text="{Binding DescriptionText}" Width="500" TextWrapping="Wrap"/>
        <Grid FocusManager.FocusedElement="{Binding ElementName=PasswordBox}">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <TextBlock Text="{Binding DatabaseServerText}" Grid.Row="0" Grid.Column="0"/>
            <TextBox Text="{Binding DatabaseServer, Mode=TwoWay}" x:Name="DatabaseServer" Grid.Row="0" Grid.Column="1"/>
            <TextBlock Text="{Binding UsernameText}" Grid.Row="1" Grid.Column="0"/>
            <TextBox Text="{Binding UserName, Mode=TwoWay}" Grid.Row="1" Grid.Column="1" IsEnabled="{Binding IsSqlAuthenticationEnabled}"/>
            <TextBlock Text="{Binding PasswordText}" Grid.Row="2" Grid.Column="0"/>
            <PasswordBox x:Name="PasswordBox" Grid.Row="2" Grid.Column="1" IsEnabled="{Binding IsSqlAuthenticationEnabled}"/>
        </Grid>
        <CheckBox Content="{Binding WindowsAuthenticationText}" IsChecked="{Binding IsWindowsAuthenticationChecked, Mode=TwoWay}"/>
        <TextBlock Text="{Binding OutputText}" Width="500" Foreground="{Binding OutputTextColor}" TextWrapping="Wrap"/>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button Content="{Binding CancelText}" Grid.Column="1" Command="{Binding CancelCommand}" Style="{StaticResource RedButtonCancel}" Width="200"/>
            <Button Content="{Binding SaveAndCloseText}" Grid.Column="3" Command="{Binding SaveConnectionStringCommand}" Width="200" Style="{StaticResource BlueButtonOk}" IsEnabled="{Binding IsSaveButtonEnabled}"/>
        </Grid>
    </StackPanel>
</Window>


