<Window x:Class="ThickTcpUiInWindow.Window_HistoryScan2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
        Title="Window_HistoryScan2" Height="465" Width="969" Loaded="Window_Loaded">
    <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 Source="pack://application:,,,/ThickTcpUiInWindow;component/Culture/StringResource.zh-CN.xaml"/>-->
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="80" />
            <RowDefinition Height="259*" />
        </Grid.RowDefinitions>
        <TextBlock Height="60" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="12,9,0,0" Text="{DynamicResource strHistoryData}" FontSize="48"  />
        <TextBlock Height="23" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="211,17,0,0" FontSize="18">
            <Run Text="{DynamicResource strProduct}"  />
            <Run Text="{Binding ProductName}" Foreground="#FFBA3737" />
        </TextBlock>
        <TextBlock Height="23" HorizontalAlignment="Left" Margin="211,46,0,0" VerticalAlignment="Top" >
            <Run Text="{DynamicResource strTime}" FontSize="18" />
            <Run Text="{Binding TimeBegin}"/> 
            <Run Text="~"/>
            <Run Text="{Binding TimeEnd}"/>
        </TextBlock>
        <TabControl Grid.Row="1" >
            <TabControl.Resources>
                <ResourceDictionary>
                    <Style TargetType="TextBlock" x:Key="style_tb_header">
                        <Setter Property="FontSize" Value="24"/>
                        <Setter Property="Width" Value="120"/>
                        <Setter Property="TextAlignment" Value="Center"/>
                    </Style>
                </ResourceDictionary>
            </TabControl.Resources>
            <TabItem >
                <TabItem.Header>
                    <TextBlock Text="{DynamicResource strVerticalTrend}" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                        <WindowsFormsHost >
                            <Chr:Chart x:Name="chart_trend" />
                        </WindowsFormsHost>
            </TabItem>
            <TabItem >
                <TabItem.Header>
                    <TextBlock Text="σ %" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                <WindowsFormsHost >
                    <Chr:Chart x:Name="chart_sigma" />
                </WindowsFormsHost>
            </TabItem>
            <TabItem >
                <TabItem.Header>
                    <TextBlock Text="{DynamicResource strConvolution}" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                <WindowsFormsHost >
                    <Chr:Chart x:Name="chart_convolution" />
                </WindowsFormsHost>
            </TabItem>
            <TabItem >
                <TabItem.Header>
                    <TextBlock Text="{DynamicResource strHistogram}" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                <WindowsFormsHost >
                    <Chr:Chart x:Name="chart_ud" />
                </WindowsFormsHost>
            </TabItem>
            <TabItem Name="tabItem2">
                <TabItem.Header>
                    <TextBlock Text="{DynamicResource strHorizontal}" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="158*" />
                    </Grid.RowDefinitions>
                    <StackPanel Orientation="Horizontal" Margin="5">
                        <StackPanel.Resources>
                            <ResourceDictionary>
                                <Style TargetType="Border">
                                    <Setter Property="Background" Value="Silver" />
                                    <Setter Property="BorderBrush" Value="Silver" />
                                    <Setter Property="BorderThickness" Value="1" />
                                    <Setter Property="Height" Value="90" />
                                    <Setter Property="Width" Value="150" />
                                    <Setter Property="Margin" Value="5,0" />
                                </Style>
                            </ResourceDictionary>
                        </StackPanel.Resources>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" FontSize="18" >
                                    <Run Text="{DynamicResource strSample}"/><Run Text="0 AD"/>
                                </TextBlock>
                                <TextBlock Margin="5" Text="{Binding TempAD}" FontSize="32" />
                            </StackPanel>
                            
                        </Border>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" FontSize="18" >
                                    <Run Text="{DynamicResource strSample}" /><Run Text="1 AD"/>
                                </TextBlock>
                                <TextBlock Margin="5" Text="{Binding SampleAD}" FontSize="32" />
                            </StackPanel>
                        </Border>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" Text="{DynamicResource strSlope}" FontSize="18" />
                                <TextBlock Margin="5" Text="{Binding Comp,StringFormat={}{0:F3}}" FontSize="32" />
                            </StackPanel>
                        </Border>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" Text="{DynamicResource strOffset}" FontSize="18" />
                                <TextBlock Margin="5" Text="{Binding Shift,Converter={StaticResource ResourceKey=thickconv}}" FontSize="32" />
                            </StackPanel>
                        </Border>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" Text="{DynamicResource strAvg}" FontSize="18" />
                                <TextBlock Margin="5" Text="{Binding Avg,Converter={StaticResource ResourceKey=thickconv}}" FontSize="32" />
                            </StackPanel>
                        </Border>
                        <Border>
                            <StackPanel Orientation="Vertical">
                                <TextBlock Margin="5" Text="{DynamicResource strTime}" FontSize="18" />
                                <Viewbox>
                                    <TextBlock Margin="5" Text="{Binding Time, StringFormat={}{0:g}}" FontSize="32" />
                                </Viewbox>
                            </StackPanel>
                        </Border>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="5,0" Grid.Row="1">
                        <StackPanel.Resources>
                            <ResourceDictionary>
                                <Style TargetType="Button">
                                    <Setter Property="Margin" Value="5,0"/>
                                    <Setter Property="Height" Value="38"/>
                                    <Setter Property="Width" Value="102"/>
                                </Style>
                            </ResourceDictionary>
                        </StackPanel.Resources>
                        <Button Content="{DynamicResource strPreData}" Click="button_up_Click" />
                        <Button Content="{DynamicResource strNextData}" Click="button_down_Click" />
                        <Border>
                                <TextBlock Margin="5" FontSize="32" >
                                    <Run Text="{Binding Index}" />
                                    <Run Text="/" />
                                    <Run Text="{Binding Total}" />
                                </TextBlock>
                        </Border>
                    </StackPanel>
                    <WindowsFormsHost Grid.Row="2" Margin="10,5">
                        <Chr:Chart x:Name="chart_scan" />
                    </WindowsFormsHost>
                </Grid>
            </TabItem>
            <TabItem Name="tabItem3">
                <TabItem.Header>
                    <TextBlock Text="{DynamicResource strConfiguration}" Style="{StaticResource ResourceKey=style_tb_header}"/>
                </TabItem.Header>
                <Grid />
            </TabItem>
        </TabControl>
    </Grid>
</Window>
