<?xml version="1.0" encoding="utf-8"?>
<Window x:Name="Fill_Data"
        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:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
        mc:Ignorable="d"
        Title="ใส่คานในผนัง" Height="300" Width="400" FontFamily="Poppins"
        WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Window.Resources>
        <!-- Colors -->
        <SolidColorBrush x:Key="PrimaryBlueColor" Color="Teal"/>
        <SolidColorBrush x:Key="SecondaryBlueColor" Color="#FFE5E5E5"/>
        <SolidColorBrush x:Key="Color2" Color="#FF1D49DE"/>
        <SolidColorBrush x:Key="Color3" Color="#FFEA841E"/>
        <SolidColorBrush x:Key="PrimaryTextColor" Color="#FFFFFF"/>
        <SolidColorBrush x:Key="SecondaryTextColor" Color="Black"/>

        <SolidColorBrush x:Key="PrimaryGrayColor" Color="#BBC1D1"/>
        <SolidColorBrush x:Key="PrimaryWhiteColor" Color="White"/>




        <!-- Start: Styles-->

        <!-- Start TabItem Style-->
        <Style x:Key="TabItemStyle" TargetType="TabItem">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Foreground" Value="{DynamicResource SecondaryTextColor}"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Margin" Value="0 0 5 0"/>
            <Setter Property="Width" Value="90"/>
            <Setter Property="Padding" Value="10 8"/>
            <Setter Property="FontWeight" Value="500"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TabItem">
                        <Grid SnapsToDevicePixels="True">
                            <Border CornerRadius="5"
                                    Background="{TemplateBinding Background}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    Margin="{TemplateBinding Margin}"/>

                            <ContentPresenter HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              SnapsToDevicePixels="True"
                                              RecognizesAccessKey="True"
                                              Margin="{TemplateBinding Padding}"
                                              ContentSource="Header"
                                              Focusable="False"/>

                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background"
                                        Value="{DynamicResource SecondaryBlueColor}"/>
                                <Setter Property="Foreground"
                                        Value="{DynamicResource PrimaryGrayColor}">

                                </Setter>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter Property="Background"
                                        Value="{DynamicResource PrimaryBlueColor}"/>
                                <Setter Property="Foreground"
                                        Value="{DynamicResource PrimaryTextColor}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!-- End: TabItem Style-->

        <!-- Start: TabControl Style-->
        <Style x:Key="TabControlStyle" TargetType="TabControl">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Padding" Value="5"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TabControl">
                        <Grid SnapsToDevicePixels="True">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TabPanel Grid.Row="0"
                                      Background="Transparent"
                                      IsItemsHost="True"
                                      HorizontalAlignment="Left"/>
                            <Border Grid.Row="1"
                                    CornerRadius="5"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                                <ContentPresenter ContentSource="SelectedContent"
                                                  SnapsToDevicePixels="True"
                                                  Margin="{TemplateBinding Padding}"/>

                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- Button Style-->
        <Style x:Key="ButtonControlStyle" TargetType="Button">
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="FontSize" Value="15"/>

        </Style>
        <Style x:Key="ButtonControlStyle2" TargetType="Button">
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="FontStyle" Value="Oblique"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Background" Value="{DynamicResource Color2}"/>
            <Setter Property="Foreground" Value="{DynamicResource PrimaryWhiteColor}"/>

        </Style>

        <Style x:Key="ButtonControlStyle3" TargetType="Button">
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="FontStyle" Value="Oblique"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Background" Value="{DynamicResource Color3}"/>
            <Setter Property="Foreground" Value="{DynamicResource PrimaryWhiteColor}"/>

        </Style>

        <!-- DataGrid Style-->



    </Window.Resources>
    <Grid Background="{DynamicResource PrimaryBlueColor}" HorizontalAlignment="Right" Width="390">
        <Grid.RowDefinitions>

            <RowDefinition Height="300"/>

        </Grid.RowDefinitions>


        <Border Grid.Row="0" 
                CornerRadius="12"
                Background="#FFE5E5E5"
                Padding="0" Margin="20,20,12,30" Height="220" Width="330" VerticalAlignment="Top">
            <StackPanel HorizontalAlignment="Left" Height="220" Margin="10,10,0,0" VerticalAlignment="Top" Width="320">
                <Label Content="เลือกประเภททับหลัง :" HorizontalAlignment="Left" Height="25" Margin="15,10,0,0" VerticalAlignment="Top" Width="100"/>
                <ComboBox x:Name="cmbLintel" Height="25"
                               HorizontalContentAlignment="Left" VerticalContentAlignment="Center" HorizontalAlignment="Left"
                               Margin="140,-25,0,0" Width="150" VerticalAlignment="Top"
                               SelectionChanged="cmbLintel_SelectionChanged"/>

                <Label Content="เลือกขนาดทับหลัง :" HorizontalAlignment="Left" Height="25" Margin="15,15,0,0" VerticalAlignment="Top" Width="100"/>
                <ComboBox x:Name="cmbLintelSize" Height="25"
                               HorizontalContentAlignment="Left" VerticalContentAlignment="Center" HorizontalAlignment="Left"
                               Margin="140,-25,0,0" Width="150" VerticalAlignment="Top"
                               SelectionChanged="cmbLintelSize_SelectionChanged"/>               
                <Label Content="ความสูงทับหลังจากท้องพื้น :" HorizontalAlignment="Left" Height="25" Width="140"  VerticalAlignment="Top" Margin="15,20,0,0"/>
                
                <TextBox x:Name="tbHeight" Height="25" HorizontalAlignment="Left" VerticalAlignment="Top"
                                 Margin="190,-25,0,0"  Text="2500" Width="60" VerticalContentAlignment="Center" HorizontalContentAlignment="Right" />
                <Label Content="มม." Height="25" Margin="263,-25,37,0" Width="50"/>
                <Button x:Name="fillBeamBtn" Style="{DynamicResource ButtonControlStyle2}" Content="ใส่คานในผนัง"
                                HorizontalAlignment="Left" Height="30" Width="80" Margin="50,30,0,0" VerticalAlignment="Top"
                                Click ="fillBeam"   />
                <Button x:Name="cancelBtn" Style="{DynamicResource ButtonControlStyle3}" Content="ยกเลิก"
                                HorizontalAlignment="Left" Height="30" Width="80" Margin="180,-30,0,0" VerticalAlignment="Top"
                                Click ="cancelBtn"  />





            </StackPanel>
        </Border>




    </Grid>
</Window>

