<Window x:Class="Flyad7_WPF.WdGridAdvAnalyze"
        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:Flyad7_WPF"
        xmlns:Chr="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization"
        mc:Ignorable="d"
        Title="WdGridAdvAnalyze" Width="800" d:DataContext="{d:DesignInstance Type=local:WdGridAdvAnalyzeVm}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="WdGridAdvAnalyzeStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <StackPanel Margin="5">
            <TextBlock Style="{StaticResource tbkTitle}" >
                R=<Run Text="{Binding R,StringFormat={}{0:F4}}"/> <LineBreak/>
                Speed=<Run Text="{Binding Speed,StringFormat={}{0:F1}}"/>
            </TextBlock>
            <Button Style="{StaticResource btnNormal}" Content="加载" Command="{Binding LoadCmd}"/>
            <Button Style="{StaticResource btnNormal}" Content="自动计算" Command="{Binding AutoCmd}"/>
            <Button Style="{StaticResource btnNormal}" Content="自动2" Command="{Binding Auto2Cmd}"/>
            <Button Style="{StaticResource btnNormal}" Content="手动计算" Command="{Binding ManualCmd}"/>
            <Button Style="{StaticResource btnNormal}" Content="清除R" Command="{Binding ClearRCmd}"/>
            <Button Style="{StaticResource btnNormal}" Content="卷积调试" Command="{Binding ConvDebugCmd}"/>
            <TextBlock Style="{StaticResource tbkTitle}">
                CurrR=<Run Text="{Binding CurrR,StringFormat={}{0:F6}}"/>
            </TextBlock>
            <TextBlock Style="{StaticResource tbkTitle}">
                CurrGroupR=<Run Text="{Binding CurrGroupR,StringFormat={}{0:F6}}"/>
            </TextBlock>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="K1*X(n)"/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding Ks[0],StringFormat={}{0:F6}}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="K2*Y(n-1)"/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding Ks[1],StringFormat={}{0:F6}}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="K3*X(n-1)"/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding Ks[2],StringFormat={}{0:F6}}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="K4*Y(n-2)"/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding Ks[3],StringFormat={}{0:F6}}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="K5*X(n-2)"/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding Ks[4],StringFormat={}{0:F6}}"/>
            </StackPanel>
            <TextBlock Style="{StaticResource tbkTitle}">
                CellCnt=<Run Text="{Binding CellCnt,Mode=OneWay}"/>
            </TextBlock>
            <StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource tbkTitle}" Text="SampleCellIdx="/>
                <TextBox Style="{StaticResource txtInput}" Text="{Binding SampleCellIdx}"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Button Style="{StaticResource btnNormal}" Content="Pre" Command="{Binding PreIdxCmd}"/>
                <Button Style="{StaticResource btnNormal}" Content="Next" Command="{Binding NextIdxCmd}"/>
            </StackPanel>
        </StackPanel>
        <Grid Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <WindowsFormsHost Grid.Row="0">
                <Chr:Chart x:Name="chart2" />
            </WindowsFormsHost>
            <WindowsFormsHost Grid.Row="1">
                <Chr:Chart x:Name="chart0" />
            </WindowsFormsHost>
            <WindowsFormsHost Grid.Row="2">
                <Chr:Chart x:Name="chart1" />
            </WindowsFormsHost>
        </Grid>

    </Grid>
</Window>
