<Window x:Class="ReAct_PME.ParametresCompteMail"
        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:ReAct_PME"
        mc:Ignorable="d"
        Title="Parametres du Compte Mail" Height="530" Width="500" Background="#FFF0F0F0">
    <Grid Margin="10,10,10,10">
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="50"/>
            <RowDefinition Height="*"/>

        </Grid.RowDefinitions>
        <TextBlock Text="Serveur IMAP :" Grid.Row="0" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.ServeurImap, Mode=TwoWay}"  MaxLength="255"  Grid.Row="0" Margin="200,0,0,0"/>

        <TextBlock Text="Port Serveur IMAP :" Grid.Row="1" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.ServeurImapPort, Mode=TwoWay}"  MaxLength="255"  Grid.Row="1" Margin="200,0,0,0"/>

        <TextBlock Text="Serveur SMTP :" Grid.Row="2" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.ServeurSmtp, Mode=TwoWay}"  MaxLength="255"  Grid.Row="2" Margin="200,0,0,0"/>

        <TextBlock Text="Port Serveur SMTP :" Grid.Row="3" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.ServeurSmtpPort, Mode=TwoWay}"  MaxLength="255"  Grid.Row="3" Margin="200,0,0,0"/>

        <TextBlock Text="Adresse mail :" Grid.Row="4" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.UserAdresse, Mode=TwoWay}"  MaxLength="255"  Grid.Row="4" Margin="200,0,0,0"/>

        <TextBlock Text="Mot de passe :" Grid.Row="5" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.UserMotPasse, Mode=TwoWay}"  MaxLength="255"  Grid.Row="5" Margin="200,0,0,0"/>

        <TextBlock Text="Vos nom et prénom :" Grid.Row="6" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.UserNomPrenom, Mode=TwoWay}"  MaxLength="255"  Grid.Row="6" Margin="200,0,0,0"/>

        <TextBlock Text="Votre rôle :" Grid.Row="7" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.UserRole, Mode=TwoWay}"  MaxLength="255"  Grid.Row="7" Margin="200,0,0,0"/>

        <TextBlock Text="Votre entreprise :" Grid.Row="8" VerticalAlignment="Center"/>
        <TextBox Text="{Binding SelectedItem.UserEntreprise, Mode=TwoWay}"  MaxLength="255"  Grid.Row="8" Margin="200,0,0,0"/>

        <TextBlock Text="Rafraichissement réception (en min) :" Grid.Row="9" VerticalAlignment="Center"/>
        <TextBox  x:Name="IntTextBox" Text="{Binding SelectedItem.DelayRefresh, Mode=TwoWay}"  MaxLength="10"  Grid.Row="9" Margin="200,0,0,0"
             PreviewTextInput="NumericOnly_PreviewTextInput"
             TextChanged="IntTextBox_TextChanged"
             PreviewKeyDown="NumericOnly_PreviewKeyDown" 
             ToolTip="Indique le délai de rafraîchissement du traitement de la réception des nouveaux mails" />

        <TextBlock Text="Rafraichissement envoi (en min) :" Grid.Row="10" VerticalAlignment="Center"/>
        <TextBox  x:Name="IntTextBox2" Text="{Binding SelectedItem.DelaySentRefresh, Mode=TwoWay}"  MaxLength="10"  Grid.Row="10" Margin="200,0,0,0"
             PreviewTextInput="NumericOnly_PreviewTextInput"
             TextChanged="IntTextBox2_TextChanged"
             PreviewKeyDown="NumericOnly_PreviewKeyDown" 
             ToolTip="Indique le délai de rafraîchissement du traitement des mails envoyés" />

        <TextBlock Text="Récupération des envois (en jours) :" Grid.Row="11" VerticalAlignment="Center"/>
        <TextBox  x:Name="IntTextBox3" Text="{Binding SelectedItem.DelaySentRecup, Mode=TwoWay}"  MaxLength="10"  Grid.Row="11" Margin="200,0,0,0"
             PreviewTextInput="NumericOnly_PreviewTextInput"
             TextChanged="IntTextBox3_TextChanged"
             PreviewKeyDown="NumericOnly_PreviewKeyDown" 
             ToolTip="Traitement des mails envoyés : jusqu'à quand aller chercher dans l'historique de la boîte mail" />

        <TextBlock Text="OverdueDays Sent (en jours) :" Grid.Row="12" VerticalAlignment="Center"/>
        <TextBox  x:Name="IntTextBox4" Text="{Binding SelectedItem.OverdueDaysSent, Mode=TwoWay}"  MaxLength="10"  Grid.Row="12" Margin="200,0,0,0"
             PreviewTextInput="NumericOnly_PreviewTextInput"
             TextChanged="IntTextBox4_TextChanged"
             PreviewKeyDown="NumericOnly_PreviewKeyDown" 
             ToolTip="Traitement des mails envoyés : Signaler une relance en retard au bout de quelques jours" />

        
        <TextBlock x:Name="Message" Text="..." Grid.Row="13" VerticalAlignment="Center"/>

        
        <StackPanel Orientation="Vertical" Grid.Row="14" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,0,0">
            <Button 
                Content="Sauvegarder" Width="80" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click"
                />
            <Button Content="Fermer" Width="80" Margin="5" 
                Style="{DynamicResource ButtonStyle}" 
                Click="Button_Click_1"                
                />
        </StackPanel>
    </Grid>
</Window>
