<Window x:Class="StructureHelper.Windows.BeamShears.BeamShearCalculatorView"
        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.BeamShears"
        d:DataContext="{d:DesignInstance local:BeamShearCalculatorViewModel}"
        mc:Ignorable="d"
        Title="Beam Shear Calculator" Height="300" Width="350" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Closing="Window_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <TextBlock Text="Name"/>
            <CheckBox Grid.Row="1" Content="Show trace data" IsChecked="{Binding ShowTraceData}"/>
            <TextBox Grid.Column="1" Text="{Binding Name}"/>
            <TabControl Grid.Row="2" Grid.ColumnSpan="2" DataContext="{Binding InputDataViewModel}">
                <TabItem Header="Sections">
                    <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding SectionSourceTarget}"/>
                </TabItem>
                <TabItem Header="Stirrups">
                    <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding StirrupSourceTarget}"/>
                </TabItem>
                <TabItem Header="Actions">
                    <ContentControl ContentTemplate="{StaticResource SourceToTarget}" Content="{Binding ActionSourceTarget}"/>
                </TabItem>
                <TabItem Header="Design code">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="25"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                    <ComboBox ItemsSource="{Binding ShearCodeTypeList}" SelectedItem="{Binding SelectedCodeType}"/>
                    </Grid>
                </TabItem>
                <TabItem Header="Design range" DataContext="{Binding DesignRangePropertyViewModel}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="25"/>
                            <RowDefinition Height="25"/>
                            <RowDefinition Height="25"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <TextBlock Text="Minimum absolute range"/>
                        <TextBox Grid.Column="1" Text="{Binding AbsoluteRangeValue, Converter={StaticResource LengthConverter}, ValidatesOnDataErrors=True}"/>
                        <TextBlock Grid.Row="1" Text="Minimum relative range"/>
                        <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding RelativeEffectiveDepthRangeValue, Converter={StaticResource PlainDouble}, ValidatesOnDataErrors=True}"/>
                        <TextBlock Grid.Row="2" Text="Number of step"/>
                        <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding StepCount, ValidatesOnDataErrors=True}"/>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>
        <ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
    </Grid>
</Window>
