<flyctrllib:WindowBigClose x:Class="FLY.Thick.Base.UI.WdAbHelper2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        xmlns:local="clr-namespace:FLY.Thick.Base.UI"
        Background="WhiteSmoke"
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" SizeToContent="WidthAndHeight"  >
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>

            </ResourceDictionary.MergedDictionaries>
            <local:WdAbHelperVm x:Key="viewmodel" IsJustB="True"/>
        </ResourceDictionary>
    </Window.Resources>

    <Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" d:DataContext="{StaticResource viewmodel}">
        <StackPanel Margin="{StaticResource ControlMargin}">
            <Grid Height="20"/>
            <StackPanel Orientation="Horizontal">
                <StackPanel Margin="{StaticResource ControlMargin}">
                    <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="只修正平移B"/>
                    <ToggleButton Style="{StaticResource Styles.ToggleButton.YESNO}" IsChecked="{Binding IsJustB}"/>
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <StackPanel>
                    <StackPanel Orientation="Horizontal" >
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="实际值1" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Y1}" />
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}"  Text="显示值1" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding X1}"/>
                        </StackPanel>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Visibility="{Binding IsJustB,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}">
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="实际值2" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Y2}" />
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}"  Text="显示值2"/>
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding X2}"/>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Button Style="{StaticResource Styles.Button.Square2}" Click="button_cal_Click" Content="计算"/>
                </StackPanel>
            </StackPanel>

  
            <StackPanel Margin="{StaticResource ControlMargin}">
                <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="结果"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource Styles.Text.FieldContent}" Visibility="{Binding IsJustB,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}">
                        <Run Text= "斜率K="/>
                        <Run Text= "{Binding A, StringFormat={}{0:F3}}"/>
                    </TextBlock>
                    <TextBlock Style="{StaticResource Styles.Text.FieldContent}" >
                        <Run Text= "平移B="/>
                        <Run Text= "{Binding B, StringFormat={}{0:F2}}"/>
                    </TextBlock>

                </StackPanel>
                
            </StackPanel>
            <Button Style="{StaticResource  Styles.Button.Apply}" Click="button_apply_Click" />
        </StackPanel>
    </Grid>

</flyctrllib:WindowBigClose>