﻿<UserControl x:Class="DriveDotNetGuiClient.SettingsObjects.DownloadTxtParams"
             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:localCmd="clr-namespace:DriveDotNetGuiClient.Commands"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="400">
    <UserControl.Resources>
        <localCmd:OpenFileBrowserCommand x:Key="OpenFileBrowserCommand" />
    </UserControl.Resources>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="160"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="25"/>
        </Grid.ColumnDefinitions>
        <CheckBox Grid.Row="0" Grid.ColumnSpan="3" Content="Stop in case Set one of the parameters fails"  IsChecked="{Binding Settings.StopOnError}"/>
        <CheckBox Grid.Row="1" Grid.ColumnSpan="3" Content="Download only parameters that appear in the personality model"  IsChecked="{Binding Settings.FilterParametersByPersonality}"/>
        <CheckBox Grid.Row="2" Grid.ColumnSpan="3" Content="Save parameters from RAM to flash after downloading"  IsChecked="{Binding Settings.SaveToFlash}"/>
            <TextBlock Text="Communication parameters:" Grid.Row="3" Grid.Column="0" Height="25" />
        <ComboBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" Height="25" ItemsSource="{Binding CommParamsOptions}" SelectedItem="{Binding SelectedCommParamsOptions}"/>
        <TextBlock Text="Path: " Grid.Row="4" Grid.Column="0" Height="25" />
        <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding Path}" Height="25"/>
        <Button Grid.Row="4" Grid.Column="2" Content="..." Height="25" Width="25" Command="{StaticResource OpenFileBrowserCommand}" CommandParameter="{Binding}"/>
    </Grid>
</UserControl>
