<Window x:Class="StructureHelper.Windows.CalculationWindows.CalculatorsViews.CrackCalculatorInputDataView"
        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:StructureHelper.Windows.CalculationWindows.CalculatorsViews"
        d:DataContext="{d:DesignInstance local:CrackCalculatorInputDataViewModel}"
        mc:Ignorable="d"
        Title="{Binding WindowTitle}" Height="390" Width="400" MinHeight="300" MinWidth="400"
        ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
        Closing="Window_Closing"
        >
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="35"/>
        </Grid.RowDefinitions>
        <TabControl>
            <TabItem Header="General">
                <StackPanel>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="25"/>
                            <RowDefinition Height="25"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="150"/>
                            <ColumnDefinition Width="300"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="Name"/>
                        <TextBox Grid.Column="1" Text="{Binding Name}"/>
                        <CheckBox Grid.Row="1" Content="Show trace data" IsChecked="{Binding ShowTraceData}"/>
                    </Grid>
                </StackPanel>
                
            </TabItem>
            <TabItem Header="Forces">
                <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding CombinationViewModel}"/>
            </TabItem>
            <TabItem Header="Primitives">
                <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding PrimitivesViewModel}"/>
            </TabItem>
            <TabItem Header="Settings">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <CheckBox x:Name="SetSoftFactorFlag" Grid.ColumnSpan="2" Content="Set user value of softening factor (PsiS)" IsChecked="{Binding SetSofteningFactor}"/>
                    <TextBox Grid.Row="1" Text="{Binding SofteningFactor, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"
                             IsEnabled="{Binding IsChecked, ElementName=SetSoftFactorFlag}" Margin="0,0,0,3"/>
                    <CheckBox x:Name="SetLengthFlag" Grid.ColumnSpan="2" Grid.Row="2" Content="Set user value of length between cracks (Lcrc)" IsChecked="{Binding SetLengthBetweenCracks}"/>
                    <TextBox Grid.Row="3" Text="{Binding LengthBetweenCracks, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
                             IsEnabled="{Binding IsChecked, ElementName=SetLengthFlag}" Margin="0,0,0,3"/>
                    <TextBlock Grid.Row="4" Text="Ultimate limit crack width"/>
                    <TextBlock Grid.Row="5" Text="Long-term"/>
                    <TextBox Grid.Row="5" Grid.Column="1" Text="{Binding UltLongTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
                             Margin="3"/>
                    <TextBlock Grid.Row="6" Text="Short-term"/>
                    <TextBox Grid.Row="6" Grid.Column="1" Text="{Binding UltShortTermCrackWidth, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"
                             Margin="3"/>
                </Grid>
            </TabItem>
        </TabControl>
        <ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
    </Grid>
</Window>
