<Window x:Class="StructureHelper.Windows.BeamShears.StirrupByRebarView"
        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"
        xmlns:uc="clr-namespace:StructureHelper.Windows.UserControls"
        d:DataContext="{d:DesignInstance local:StirrupByRebarViewModel}"
        mc:Ignorable="d"
        Title="Stirrup by uniformly distributed rebars" Height="350" Width="300" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
    <Window.Resources>
        <ResourceDictionary Source="/Infrastructure/UI/Resources/Materials.xaml"/>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>
        <TabControl>
            <TabItem Header="Main">
                <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/>
                    </Grid.RowDefinitions>
                    <TextBlock Text="Name"/>
                    <TextBox Grid.Column="1" Text="{Binding Name}"/>
                    <TextBlock Grid.Row="1" Text="Diameter"/>
                    <TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding Diameter, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
                    <TextBlock Grid.Row="2" Text="Number of legs"/>
                    <TextBox Grid.Row="2" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding LegCount, Converter={StaticResource PlainDouble},ValidatesOnDataErrors=True}"/>
                    <TextBlock Grid.Row="3" Text="Spacing"/>
                    <TextBox Grid.Row="3" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding Spacing, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
                    <CheckBox Grid.Row="4" Margin="0,2,0,0" Content="Spiral" IsChecked="{Binding IsSpiral}"/>
                </Grid>
            </TabItem>
            <TabItem Header="Material" DataContext="{Binding Material}">
                <ContentControl ContentTemplate="{StaticResource ReinforcementMaterial}" Content="{Binding}"/>
            </TabItem>
            <TabItem Header="Misc.">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25"/>
                        <RowDefinition Height="25"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="Start coordinate"/>
                    <TextBox Grid.Row="0" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding StartCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
                    <TextBlock Grid.Row="1" Text="End coordinate"/>
                    <TextBox Grid.Row="1" Grid.Column="1" Style="{StaticResource ValidatedError}" Text="{Binding EndCoordinate, Converter={StaticResource LengthConverter},ValidatesOnDataErrors=True}"/>
                </Grid>
            </TabItem>
            <TabItem Header="Visual">
                <uc:PrimitiveVisualProperty ObjectVisual="{Binding VisualProperty}"/>
            </TabItem>
        </TabControl>
        <ContentControl Grid.Row="1" ContentTemplate="{StaticResource OkCancelButtons}" Content="{Binding}"/>
    </Grid>
</Window>
