<Window x:Class="ThickTcpUiInWindow.Window_RemoteHistory"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window_RemoteHistory" Height="556" Width="731" Loaded="Window_Loaded" Unloaded="Window_Unloaded">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>

                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/MaterialDesignIcons.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/ThickTcpUiInWindow;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
            <RowDefinition Height="396*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Vertical" Name="stackpanel_state">
            <TextBlock  Margin="6" VerticalAlignment="Top">
                <Run Text="{DynamicResource strHistoryDataCnt}" FontSize="24" FontWeight="Bold" />
                <Run Text="{Binding CurrDays, Mode=OneWay}"/>
                <Run Text="{DynamicResource strDay}"/>
                <Run Text="/"/>
                <Run Text="{DynamicResource strUpperLimit}" Foreground="Red" />
                <Run Text="{Binding KeeyDay, Mode=OneWay}" Foreground="Red" />
                <Run Text="{DynamicResource strDay}" Foreground="Red" />
            </TextBlock>
            <Grid Margin="3">
                <StackPanel Orientation="Vertical" >
                    <TextBlock HorizontalAlignment="Left" Margin="3" Text="{DynamicResource strCurrHistoryFile}" FontSize="24" FontWeight="Bold" />
                    <TextBlock HorizontalAlignment="Left" Margin="3" >
                        <Run Text="{Binding CurrPath, Mode=OneWay}"/>
                        <Run Text="("/>
                        <Run Text="{Binding CurrRows, Mode=OneWay}"/>
                        <Run Text="/"/>
                        <Run Text="{Binding SaveRows, Mode=OneWay}"/>
                        <Run Text=")"/>
                    </TextBlock>
                </StackPanel>
                <Button Content="{DynamicResource strSaveRightNow}" Height="58" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Top" Width="119" FontSize="18" FontWeight="Bold" Click="button_rolldown_Click" />
            </Grid>
        </StackPanel>
        <Rectangle Height="2" Grid.Row="1" VerticalAlignment="Top" Margin="3" Fill="Black" />
        <Grid Name="grid_list" Margin="3" Grid.Row="2" >
            <Grid.RowDefinitions>
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="7*" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <TextBlock FontSize="24" FontWeight="Bold" HorizontalAlignment="Left" Margin="3" Text="{DynamicResource strFileList}" />
            <Grid Margin="3" Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="572*" />
                    <ColumnDefinition Width="auto" />
                </Grid.ColumnDefinitions>
                <StackPanel Orientation="Vertical">
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Margin="3" Text="{DynamicResource strBeginDate}" FontSize="18" FontWeight="Bold" />
                        <DatePicker Height="25" Margin="3" Width="183" SelectedDate="{Binding BeginDate}" />
                        <TextBlock FontSize="18" FontWeight="Bold" Margin="3" Text="{DynamicResource strEndDate}" />
                        <DatePicker Height="25" Margin="3" Width="183"  SelectedDate="{Binding EndDate}"/>

                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock FontSize="18" FontWeight="Bold" Margin="3" Text="{DynamicResource strModel}" />
                        <TextBox Height="23" Margin="3" Width="484" Text="{Binding ProductNameFilter}"/>
                    </StackPanel>
                </StackPanel>
                <Button Content="{DynamicResource strSearch}" FontSize="18" FontWeight="Bold" Height="58" Width="119" Grid.Column="1" Margin="3" Click="button_search_Click" />
            </Grid>
            <ComboBox Height="23" Margin="3"  Grid.Row="2" Name="comboBox1" SelectionChanged="comboBox1_SelectionChanged" />
            <ListBox Margin="3" Name="listBox1" Grid.Row="3" SelectionMode="Multiple" >
                <ListBox.ItemTemplate>
                    
                <DataTemplate>
                        <Grid Name="grid_listitem">
                            <Rectangle Fill="#FFFFC4C4" HorizontalAlignment="Left">
                                <Rectangle.Width>
                                    <MultiBinding Converter="{StaticResource ratioconv}" Mode="OneWay">
                                        <Binding Path="DownloadSize" />
                                        <Binding Path="Size" />
                                        <Binding Path="ActualWidth" ElementName="listBox1"/>
                                    </MultiBinding>
                                </Rectangle.Width>
                            </Rectangle>
                            <TextBlock>
                        <Run Text="{Binding FilePath}"/>
                        <Run Text="("/>
                        <Run Text="{Binding DownloadSize}"/>
                        <Run Text="/"/>
                        <Run Text="{Binding Size}"/>
                        <Run Text=")"/>
                    </TextBlock>
                            
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <ProgressBar Name="progressBar1" Height="10" Grid.Row="4" Value="{Binding Progress}" Margin="3"/>
            <StackPanel Orientation="Horizontal" Grid.Row="5" >
                <Button Content="{DynamicResource strSelectAll}" FontSize="18" FontWeight="Bold" Height="58" Margin="3" Width="119" Click="button_selsectall_Click" />
                <Button Content="{DynamicResource strRead}" FontSize="18" FontWeight="Bold" Height="58" Margin="3" Width="119" Click="button_read_Click" />
                <Button Content="{DynamicResource strOutput}" FontSize="18" FontWeight="Bold" Height="58" Margin="3" Width="119" Click="button_output_Click" />
            </StackPanel>




        </Grid>
        
    </Grid>
</Window>
