<UserControl x:Class="PolishingsPageUC"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:EgtWPFLib="clr-namespace:EgtWPFLib;assembly=EgtWPFLib" 
   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
   xmlns:self="clr-namespace:OmagCUT.TreeViewItem"
   mc:Ignorable="d" 
   d:DesignHeight="768" d:DesignWidth="1280" Initialized="PolishingsPage_Initialized" Loaded="PolishingsPage_Loaded">

    <!-- Definizione della PolishingsPage -->
    <Border Style="{DynamicResource OmagCut_PageBorder}">

        <Grid Name="PolishingsPageGrid" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition Width="8*"/>
                <ColumnDefinition Width="4*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="8*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <GroupBox Name="KitsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0"
                Grid.Row="0" BorderThickness="0">

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="7*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>

                    <ListBox Name="KitsLstBx" Grid.RowSpan="2">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding sName}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>

                    <EgtWPFLib:EgtTextBox Name="KitNameTxBx" Grid.Row="1" Width="240" Visibility="Hidden"
                  Style="{DynamicResource OmagCut_KeyboardTextBox}" />

                    <UniformGrid Grid.Row="2" Columns="3">
                        <Button Name="NewKitBtn" Grid.Column="0"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                        <Button Name="SaveKitBtn" Grid.Column="1"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                        <Button Name="RemoveKitBtn" Grid.Column="2"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                    </UniformGrid>

                </Grid>

            </GroupBox>

            <Border Style="{DynamicResource OmagCut_Border}" Grid.Column="1"
            Grid.Row="0" Grid.ColumnSpan="2" Grid.RowSpan="1">

                <Grid Name="KitParamGrd" Grid.Column="1">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>

                    <GroupBox Name="KitMachsGpBx" Style="{DynamicResource OmagCut_GroupBox}" Grid.Column="0"
                        Grid.Row="0" Grid.ColumnSpan="1" Grid.RowSpan="8" BorderThickness="0">

                        <!-- Definizione della Grid dei parametri delle lavorazioni -->
                        <Grid Name="KitMachGrd" Grid.Column="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="0.8*"/>
                            </Grid.RowDefinitions>

                            <ListBox Name="KitMachsLstBx" Grid.RowSpan="7" Grid.ColumnSpan="4">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="15"/>
                                                <ColumnDefinition Width="Auto"/>
                                                <ColumnDefinition Width="1*"/>
                                            </Grid.ColumnDefinitions>

                                            <TextBlock Text="{Binding nId}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}" Grid.Column="0"/>
                                            <CheckBox Name="ActiveChBx" IsChecked="{Binding Path=bActive, Mode=TwoWay}" Grid.Column="1" Click="CheckBox_Click" GotFocus="ActiveChBx_GotFocus"/>
                                            <ComboBox Name="ToolCmBx" Grid.Column="2" 
                                                      ItemsSource="{Binding Path=ToolList}"
                                                      SelectedIndex="{Binding Path=SelTool}"
                                                      Style="{StaticResource OmagCut_MachToolLeftComboBoxNoBorder}"
                                                      SelectionChanged="ToolCmBx_SelectionChanged"
                                                      GotFocus="ToolCmBx_GotFocus">
                                                <ComboBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                                                    </DataTemplate>
                                                </ComboBox.ItemTemplate>
                                            </ComboBox>

                                        </Grid>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>

                            <EgtWPFLib:EgtTextBox Name="KitMachNameTxBx" Grid.Row="1" Width="240" Visibility="Hidden"
                     Style="{DynamicResource OmagCut_KeyboardTextBox}" />

                            <UniformGrid Grid.Row="13" Columns="4" Grid.ColumnSpan="4">
                                <Button Name="NewKitMachBtn" Grid.Column="0"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                                <Button Name="RemoveKitMachBtn" Grid.Column="1"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                                <Button Name="MoveUpKitMachBtn" Grid.Column="2"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                                <Button Name="MoveDownKitMachBtn"  Grid.Column="3"
                     Style="{DynamicResource OmagCut_RightGrayGradientYellowTextButton}"/>
                            </UniformGrid>

                        </Grid>

                    </GroupBox>

                    <GroupBox Name="KitMachParamsGpBx" Style="{DynamicResource OmagCut_GroupBox}"
                        Grid.Column="1" Grid.Row="0" Grid.ColumnSpan="3" Grid.RowSpan="8">

                        <!-- Definizione della Grid dei parametri delle lavorazioni -->
                        <Grid Name="KitMachParamGrd" Grid.Column="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0.5*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="1*"/>
                                <RowDefinition Height="0.5*"/>

                            </Grid.RowDefinitions>

                    <!--Decrizione immagini-->        
                    <Border Grid.Row="1" Grid.Column="1" Margin="10">
                        <Image Source="../Resources/Contour.png" Stretch="Uniform"/>
                    </Border>
                    <Border Grid.Row="2" Grid.Column="1" Margin="10">
                        <Image Source="../Resources/ZigZagX.png" Stretch="Uniform"/>
                    </Border>
                    <Border Grid.Row="3" Grid.Column="1" Margin="10">
                        <Image Source="../Resources/ZigZagY.png" Stretch="Uniform"/>
                    </Border>
                    <Border Grid.Row="4" Grid.Column="1" Margin="10">
                        <Image Source="../Resources/Spiral.png" Stretch="Uniform"/>
                    </Border>

                            <!--Titolazione colonne-->
                    <TextBlock Name="MotionTxBl" Grid.Row="0" Grid.Column="1" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>
                    <TextBlock Name="RepeatTxBl" Grid.Row="0" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>
                    <TextBlock Name="StepTxBl" Grid.Row="0" Grid.Column="3" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>
                    <TextBlock Name="OffSetTxBl" Grid.Row="0" Grid.Column="4" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>
                    <TextBlock Name="RadiusTxBl" Grid.Row="0" Grid.Column="5" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>
                    <TextBlock Name="DistanceTxBl" Grid.Row="0" Grid.Column="6" Style="{DynamicResource OmagCut_ToolsDBTextBlock}" Margin="5,0" HorizontalAlignment="Center"/>

                    <!--Contornatura-->
                    <EgtWPFLib:EgtTextBox Name="ContourTxBx" Grid.Row="1" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="OffContourTxBx" Grid.Row="1" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                            
                    <!--Cammino orizzontale X-->
                    <EgtWPFLib:EgtTextBox Name="ZigZagXTxBx" Grid.Row="2" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="StepXTxBx" Grid.Row="2" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="OffZigZagXTxBx" Grid.Row="2" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="RadiusXTxBx" Grid.Row="2" Grid.Column="5" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0" Visibility="Collapsed"/>
                    <EgtWPFLib:EgtTextBox Name="DistanceXTxBx" Grid.Row="2" Grid.Column="6" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0" Visibility="Collapsed"/>
                            
                    <!--Cammino verticale Y-->
                    <EgtWPFLib:EgtTextBox Name="ZigZagYTxBx" Grid.Row="3" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="StepYTxBx" Grid.Row="3" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="OffZigZagYTxBx" Grid.Row="3" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="RadiusYTxBx" Grid.Row="3" Grid.Column="5" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0" Visibility="Collapsed"/>
                    <EgtWPFLib:EgtTextBox Name="DistanceYTxBx" Grid.Row="3" Grid.Column="6" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0" Visibility="Collapsed"/>
                            
                    <!--Cammino a spirale-->
                    <EgtWPFLib:EgtTextBox Name="SpiralTxBx" Grid.Row="4" Grid.Column="2" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="StepSpiralTxBx" Grid.Row="4" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="OffSpiralTxBx" Grid.Row="4" Grid.Column="4" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="RadiusSpiralTxBx" Grid.Row="4" Grid.Column="5" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                    <EgtWPFLib:EgtTextBox Name="DistanceSpiralTxBx" Grid.Row="4" Grid.Column="6" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>

                            <!--Parametri di lavoro condivisi-->
                    <GroupBox Name="LiLoGpBx" Grid.Row="5" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="5" Style="{DynamicResource OmagCut_GroupBox}">
                        <Grid Name="LiLoGrd">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                                <ColumnDefinition Width="2*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                              <RowDefinition Height="1*"/>
                              <RowDefinition Height="2*"/>
                              <RowDefinition Height="1*"/>
                              <RowDefinition Height="2*"/>
                              <RowDefinition Height="1*"/>
                           </Grid.RowDefinitions>

                            <TextBlock Name="LiLenTxBl" Grid.Row="1" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                            <EgtWPFLib:EgtTextBox Name="LiLenTxBx" Grid.Row="1" Grid.Column="1" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                            <TextBlock Name="LiHeightTxBl" Grid.Row="1" Grid.Column="2" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                            <EgtWPFLib:EgtTextBox Name="LiHeightTxBx" Grid.Row="1" Grid.Column="3" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>
                            <TextBlock Name="LiLoadTxBl" Grid.Row="3" Grid.Column="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                            <EgtWPFLib:EgtTextBox Name="LiLoadTxBx" Grid.Row="3" Grid.Column="1" Style="{DynamicResource OmagCut_CalculatorTextBox}" Margin="10,0"/>

                        </Grid>
                    </GroupBox>
                        </Grid>
                    </GroupBox>

                </Grid>
            </Border>
        </Grid>

    </Border>

</UserControl>
