<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"
        
        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/Converter/Converters.xaml"/>

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

    <Grid 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="{StaticResource str.WdAbHelper.IsJustB}"/>
                    <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="{StaticResource str.WdAbHelper.Y1}" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Y1}" />
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}"  Text="{StaticResource str.WdAbHelper.X1}" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" 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="{StaticResource str.WdAbHelper.Y2}" />
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Y2}" />
                        </StackPanel>
                        <StackPanel Margin="{StaticResource ControlMargin}">
                            <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}"  Text="{StaticResource str.WdAbHelper.X2}"/>
                            <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding X2}"/>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Button Style="{StaticResource Styles.Button.Square2}" Click="button_cal_Click" Content="{StaticResource str.WdAbHelper.Cal}"/>
                </StackPanel>
            </StackPanel>

  
            <StackPanel Margin="{StaticResource ControlMargin}">
                <TextBlock Style="{StaticResource Styles.Text.FieldHeader}" Text="{StaticResource str.WdAbHelper.Result}"/>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Style="{StaticResource Styles.Text.FieldContent}" Visibility="{Binding IsJustB,Converter={StaticResource visbilityconv},ConverterParameter=CollapsedWhenTrue}">
                        <Run Text= "{StaticResource str.WdAbHelper.K}"/>=
                        <Run Text= "{Binding A, StringFormat={}{0:F3}}"/>
                    </TextBlock>
                    <TextBlock Style="{StaticResource Styles.Text.FieldContent}" >
                        <Run Text= "{StaticResource str.WdAbHelper.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>
