<UserControl x:Class="MachiningDbPageUC"
   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="MachiningDbPage_Initialized" Loaded="MachiningDbPage_Loaded">

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

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

         <TreeView Name="MachiningTreeView" Background="{DynamicResource OmagCut_TreeViewBackGroundColor}">
            <TreeView.Resources>
               <!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
               <!--renderlo apribile con un solo click -->
               <HierarchicalDataTemplate DataType="{x:Type self:CathegoryItem}" ItemsSource="{Binding Items}">

                  <Grid >
                     <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="1*"/>
                     </Grid.ColumnDefinitions>

                     <Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
                     <TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" />

                  </Grid>

                  <!--Assegna ai nodi ToolItem lo Style normale dei TreeViewItem, eliminando l'ombra, data dal -->
                  <!-- multibinding quando sono attivi.-->
                  <HierarchicalDataTemplate.ItemContainerStyle>
                     <Style TargetType="{x:Type TreeViewItem}" >
                        <Setter Property="Foreground" Value="{DynamicResource OmagCut_TreeViewTextColor}" />
                        <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                        <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
                        <Setter Property="Template">
                           <Setter.Value>
                              <ControlTemplate TargetType="{x:Type TreeViewItem}">
                                 <Grid>
                                    <Grid.ColumnDefinitions>
                                       <ColumnDefinition MinWidth="19" Width="Auto"/>
                                       <ColumnDefinition Width="Auto"/>
                                       <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                       <RowDefinition Height="Auto"/>
                                       <RowDefinition/>
                                    </Grid.RowDefinitions>
                                    <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
                                    <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                                       <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                    </Border>
                                    <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
                                    <Rectangle Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" VerticalAlignment="Top" Fill="{DynamicResource OmagCut_TreeViewDelimiterColor}" Height="1" />
                                 </Grid>
                                 <ControlTemplate.Triggers>
                                    <Trigger Property="IsExpanded" Value="false">
                                       <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
                                    </Trigger>
                                    <Trigger Property="HasItems" Value="false">
                                       <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
                                    </Trigger>
                                    <Trigger Property="IsSelected" Value="true">
                                       <Setter Property="Background" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBackground}" />
                                       <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBorder}"/>
                                       <Setter Property="BorderThickness" TargetName="Bd" Value="1"/>
                                       <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
                                    </Trigger>
                                    <!--<MultiTrigger>
                                       <MultiTrigger.Conditions>
                                          <Condition Property="IsSelected" Value="true"/>
                                          <Condition Property="IsSelectionActive" Value="false"/>
                                       </MultiTrigger.Conditions>
                                       <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                       <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                                    </MultiTrigger>-->
                                    <Trigger Property="IsEnabled" Value="false">
                                       <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                    </Trigger>
                                 </ControlTemplate.Triggers>
                              </ControlTemplate>
                           </Setter.Value>
                        </Setter>
                     </Style>
                  </HierarchicalDataTemplate.ItemContainerStyle>
               </HierarchicalDataTemplate>
               <!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
               <DataTemplate DataType="{x:Type self:CustomItem}">
                  <Grid >
                     <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="1*"/>
                     </Grid.ColumnDefinitions>

                     <!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
                     <TextBlock Grid.Column="1" Text="{Binding Name}" Height="18" FontSize="15"  Margin="10"/>

                  </Grid>
               </DataTemplate>
            </TreeView.Resources>

            <!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia -->
            <!--che si presenta quando la categoria rimane vuota (ombra causata dal multibinding). -->
            <TreeView.ItemContainerStyle>
               <Style TargetType="{x:Type TreeViewItem}">
                  <Setter Property="Foreground" Value="{DynamicResource OmagCut_TreeViewTextColor}" />
                  <Setter Property="IsSelected" Value="{Binding IsSelected}" />
                  <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
                  <Setter Property="Template">
                     <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TreeViewItem}">
                           <Grid>
                              <Grid.ColumnDefinitions>
                                 <ColumnDefinition MinWidth="19" Width="Auto"/>
                                 <ColumnDefinition Width="Auto"/>
                                 <ColumnDefinition Width="*"/>
                              </Grid.ColumnDefinitions>
                              <Grid.RowDefinitions>
                                 <RowDefinition Height="Auto"/>
                                 <RowDefinition/>
                              </Grid.RowDefinitions>
                              <Border x:Name="ExpanderBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                                 <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
                              </Border>
                              <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
                                 <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                              </Border>
                              <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
                              <Rectangle Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Fill="{DynamicResource OmagCut_TreeViewDelimiterColor}" Height="1" />
                           </Grid>
                           <ControlTemplate.Triggers>
                              <Trigger Property="IsExpanded" Value="false">
                                 <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
                              </Trigger>
                              <Trigger Property="HasItems" Value="false">
                                 <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
                              </Trigger>
                              <Trigger Property="IsSelected" Value="true">
                                 <Setter Property="Background" TargetName="Bd" >
                                     <Setter.Value>
                                         <SolidColorBrush Color="Yellow" Opacity="0.4"/>
                                     </Setter.Value>
                                 </Setter>
                                 <Setter Property="Background" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBackground}"/>
                                 <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource OmagCut_TreeViewSelectedItemBorder}"/>
                                 <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1"/>
                                 <Setter Property="Background" TargetName="ExpanderBorder" Value="{DynamicResource OmagCut_TreeViewSelectedItemBackground}"/>
                                 <Setter Property="BorderBrush" TargetName="ExpanderBorder" Value="{DynamicResource OmagCut_TreeViewSelectedItemBorder}"/>
                                 <Setter Property="BorderThickness" TargetName="ExpanderBorder" Value="1,1,0,1"/>
                                 <!--<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>-->
                              </Trigger>
                              <!--<MultiTrigger>
                                 <MultiTrigger.Conditions>
                                    <Condition Property="IsSelected" Value="true"/>
                                    <Condition Property="IsSelectionActive" Value="false"/>
                                 </MultiTrigger.Conditions>
                                 <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                 <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                              </MultiTrigger>-->
                              <Trigger Property="IsEnabled" Value="false">
                                 <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                              </Trigger>
                           </ControlTemplate.Triggers>
                        </ControlTemplate>
                     </Setter.Value>
                  </Setter>
               </Style>
            </TreeView.ItemContainerStyle>
         </TreeView>

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

            <TextBlock Name="NameTxBl" Grid.Column="0" Grid.Row="0" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <EgtWPFLib:EgtTextBox Name="NameTxBx" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />

            <TextBlock Name="DepthTxBl" Grid.Column="0" Grid.Row="3" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <EgtWPFLib:EgtTextBox Name="DepthTxBx" Grid.Column="1" Grid.Row="3" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_LeftKeyboardTextBoxNoBorder}" />

            <!-- Parametri Taglio -->

            <TextBlock Name="SideAngleTxBl" Grid.Column="2" Grid.Row="3" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <EgtWPFLib:EgtTextBox Name="SideAngleTxBx" Grid.Column="3" Grid.Row="3" Grid.RowSpan="3" Margin="0,0,15,0"
               Style="{DynamicResource OmagCut_CalculatorTextBox}" />

            <TextBlock Name="StepTypeTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <ComboBox Name="StepTypeCmBx" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3" Style="{StaticResource OmagCut_LeftComboBoxNoBorder}">
               <ComboBox.ItemTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                  </DataTemplate>
               </ComboBox.ItemTemplate>
            </ComboBox>

            <TextBlock Name="AcrossTxBl" Grid.Row="3" Grid.Column="2" Grid.RowSpan="3"
                Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <CheckBox Name="AcrossChBx" Grid.Row="3" Grid.Column="3" Grid.RowSpan="3" Style="{StaticResource OmagCut_CheckBox_Single}"/>

            <TextBlock Name="InvertTxBl" Grid.Row="6" Grid.Column="2" Grid.RowSpan="3"
                Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <CheckBox Name="InvertChBx" Grid.Row="6" Grid.Column="3"  Grid.RowSpan="3" Style="{StaticResource OmagCut_CheckBox_Single}"/>

             <Border Name="SideBrd" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_NoNameGroupBorder}">

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

                        <TextBlock Name="WorkSideTxBl" Grid.Column="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <ComboBox Name="WorkSideCmBx" Grid.Column="1" Grid.Row="5" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Name="HeadSideTxBl" Grid.Column="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <ComboBox Name="HeadSideCmBx" Grid.Column="4" Grid.Row="5" Style="{StaticResource OmagCut_RightComboBoxInBorder}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                    </Grid>

                </Border>

                <Border Name="TypeBrd" Grid.Column="0" Grid.Row="12" Grid.ColumnSpan="4" Grid.RowSpan="6"
                   Style="{DynamicResource OmagCut_NoNameGroupBorder}">
                   
                   <Grid Name="TypeGrd">
                      <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="2*"/>
                         <ColumnDefinition Width="2*"/>
                         <ColumnDefinition Width="2*"/>
                         <ColumnDefinition Width="2*"/>
                      </Grid.ColumnDefinitions>
                      <Grid.RowDefinitions>
                         <RowDefinition Height="1*"/>
                         <RowDefinition Height="1*"/>
                      </Grid.RowDefinitions>
                   
                      <TextBlock Name="StartPosTxBl" Grid.Column="0" Grid.Row="0"
                         Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                      <EgtWPFLib:EgtTextBox Name="StartPosTxBx" Grid.Column="1" Grid.Row="0"
                         Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />
                   
                      <TextBlock Name="LeadInTypeTxBl" Grid.Column="2" Grid.Row="0"
                         Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                      <ComboBox Name="LeadInTypeCmBx" Grid.Column="3" Grid.Row="0" Style="{StaticResource OmagCut_RightComboBoxInBorder}">
                         <ComboBox.ItemTemplate>
                            <DataTemplate>
                               <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                            </DataTemplate>
                         </ComboBox.ItemTemplate>
                      </ComboBox>
                   
                      <!--Questo è solo per sgrossatura con lama-->
                      <TextBlock Name="LeadLinkTypeTxBl" Grid.Column="2" Grid.Row="0"
                         Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                      <ComboBox Name="LeadLinkTypeCmBx" Grid.Column="3" Grid.Row="0" Style="{StaticResource OmagCut_RightComboBoxInBorder}">
                         <ComboBox.ItemTemplate>
                            <DataTemplate>
                               <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                            </DataTemplate>
                         </ComboBox.ItemTemplate>
                      </ComboBox>
                   
                      <TextBlock Name="ExtLinkTypeTxBl" Grid.Column="0" Grid.Row="1"
                         Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                      <ComboBox Name="ExtLinkTypeCmBx" Grid.Column="1" Grid.Row="1" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
                         <ComboBox.ItemTemplate>
                            <DataTemplate>
                               <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                            </DataTemplate>
                         </ComboBox.ItemTemplate>
                      </ComboBox>
                   
                      <TextBlock Name="LeadOutTypeTxBl" Grid.Column="2" Grid.Row="1"
                         Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                      <ComboBox Name="LeadOutTypeCmBx" Grid.Column="3" Grid.Row="1" Style="{StaticResource OmagCut_RightComboBoxInBorder}">
                         <ComboBox.ItemTemplate>
                            <DataTemplate>
                               <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                            </DataTemplate>
                         </ComboBox.ItemTemplate>
                      </ComboBox>

                        <!--Le seguenti sono solo per WaterJetting-->

                        <TextBlock Name="LiTangTxBl" Grid.Column="0" Grid.Row="1"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LiTangTxBx" Grid.Column="1" Grid.Row="1"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="LiPerpTxBl" Grid.Column="0" Grid.Row="2"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LiPerpTxBx" Grid.Column="1" Grid.Row="2"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="LoTangTxBl" Grid.Column="2" Grid.Row="1"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LoTangTxBx" Grid.Column="3" Grid.Row="1"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="LoPerpTxBl" Grid.Column="2" Grid.Row="2"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LoPerpTxBx" Grid.Column="3" Grid.Row="2"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                    </Grid>

            </Border>

            <Border Name="CurveBrd" Grid.Column="0" Grid.Row="15" Grid.ColumnSpan="4" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_NoNameGroupBorder}">

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

                  <TextBlock Name="CurveUseTxBl" Grid.Column="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <ComboBox Name="CurveUseCmBx" Grid.Column="1" Grid.Row="0" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
                     <ComboBox.ItemTemplate>
                        <DataTemplate>
                           <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                        </DataTemplate>
                     </ComboBox.ItemTemplate>
                  </ComboBox>

                  <TextBlock Name="ApproxTxBl" Grid.Column="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ApproxTxBx" Grid.Column="3"
                     Style="{DynamicResource OmagCut_MachRightCalculatorTextBoxInBorder}" />

               </Grid>

            </Border>

            <GroupBox Name="SawStepGpBx" Grid.Column="0" Grid.Row="21" Grid.ColumnSpan="4" Grid.RowSpan="8"
               Style="{DynamicResource OmagCut_GroupBox}">

               <Grid Name="SawStepGrd">
                  <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*"/>
                  </Grid.RowDefinitions>

                  <TextBlock Name="ForwardSawStepTxBl" Grid.Column="0" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  
                  <TextBlock Name="BackwardSawStepTxBl" Grid.Column="2" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="BackwardSawStepTxBx" Grid.Column="3" Grid.Row="0"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
                  <TextBlock Name="ForwardStepSideAngTxBl" Grid.Column="0" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ForwardStepSideAngTxBx" Grid.Column="1" Grid.Row="1"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
                  
                  <TextBlock Name="BackwardStepSideAngTxBl" Grid.Column="2" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="BackwardStepSideAngTxBx" Grid.Column="3" Grid.Row="1"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="ArcIntTxBl" Grid.Column="0" Grid.Row="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ArcIntTxBx" Grid.Column="1" Grid.Row="2"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}"/>

                  <TextBlock Name="ArcExtTxBl" Grid.Column="2" Grid.Row="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ArcExtTxBx" Grid.Column="3" Grid.Row="2"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}"/>

                  <TextBlock Name="LastSawStepTxBl" Grid.Column="0" Grid.Row="3"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="LastSawStepTxBx" Grid.Column="1" Grid.Row="3"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

               </Grid>

            </GroupBox>

            <!-- Parametri presenti in entrambe le lavorazioni ma in posizioni diverse fissate da codice -->


            <!-- Parametri Foratura -->

            <TextBlock Name="ThrouAddLenTxBl" Grid.Column="2" Grid.Row="6" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <EgtWPFLib:EgtTextBox Name="ThrouAddLenTxBx" Grid.Column="3" Grid.Row="6" Grid.RowSpan="3" Margin="0,0,15,0"
               Style="{DynamicResource OmagCut_CalculatorTextBox}" />

            <GroupBox Name="LowLenGpBx" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="4"
               Style="{DynamicResource OmagCut_GroupBox}">

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

                  <TextBlock Name="StartsLowLenTxBl" Grid.Column="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="StartsLowLenTxBx" Grid.Column="1" Grid.Row="3"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="EndsLowLenTxBl" Grid.Column="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="EndsLowLenTxBx" Grid.Column="3" Grid.Row="3"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

               </Grid>

            </GroupBox>

            <Border Name="DrillStepBrd" Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="4" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_NoNameGroupBorder}">

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

                  <TextBlock Name="DrillStepTxBl" Grid.Column="0" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="StepTxBx" Grid.Column="1" Grid.Row="0"
                     Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                  <TextBlock Name="ReturnPosTxBl" Grid.Column="2" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ReturnPosTxBx" Grid.Column="3" Grid.Row="0"
                     Style="{DynamicResource OmagCut_MachRightCalculatorTextBoxInBorder}" />

               </Grid>

            </Border>

            <!-- Parametri Sgrossatura con lama -->

            <GroupBox Name="SawRouStepGpBx" Grid.Column="0" Grid.Row="18" Grid.ColumnSpan="4" Grid.RowSpan="4"
               Style="{DynamicResource OmagCut_GroupBox}">

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

                  <TextBlock Name="SawRouStepTxBl" Grid.Column="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>

                  <TextBlock Name="SideStepTxBl" Grid.Column="2"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="SideStepTxBx" Grid.Column="3" Grid.Row="3"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

               </Grid>

            </GroupBox>

            <!-- Parametri WaterJetting -->

                <TextBlock Name="ForwardAngleTxBl" Grid.Column="0" Grid.Row="6" Grid.RowSpan="3"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                <EgtWPFLib:EgtTextBox Name="ForwardAngleTxBx" Grid.Column="1" Grid.Row="6" Grid.RowSpan="3"
                     Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                <Border Name="LiHoleBrd" Grid.Column="0" Grid.Row="9" Grid.ColumnSpan="4" Grid.RowSpan="6"
               Style="{DynamicResource OmagCut_NoNameGroupBorder}">

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

                        <TextBlock Name="LiHoleTxBl" Grid.Row="0" Grid.Column="0"
                           Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <CheckBox Name="LiHoleChBx" Grid.Row="0" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox_Single}"/>

                        <TextBlock Name="LiHoleRadTxBl" Grid.Column="2" Grid.Row="0"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LiHoleRadTxBx" Grid.Column="3" Grid.Row="0"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="LpTurnsTxBl" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2" 
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="LpTurnsTxBx" Grid.Column="1" Grid.Row="1"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="HpTurnsTxBl" Grid.Column="2" Grid.Row="1"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="HpTurnsTxBx" Grid.Column="3" Grid.Row="1"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                    </Grid>

                </Border>

                <!--Materiali-->

            <Border Name="MaterialsBrd" Grid.Column="0" Grid.Row="29" Grid.ColumnSpan="4" Grid.RowSpan="9"
               Style="{DynamicResource OmagCut_NoNameGroupBorder}">
               <Grid Name="MaterialGrd">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="2*"/>
                     <ColumnDefinition Width="2*"/>
                     <ColumnDefinition Width="2*"/>
                     <ColumnDefinition Width="2*"/>
                  </Grid.ColumnDefinitions>
                  <Grid.RowDefinitions>
                     <RowDefinition Height="5*"/>
                     <RowDefinition Height="3*"/>
                  </Grid.RowDefinitions>

                  <ListBox Name="MaterialsList" Grid.ColumnSpan="4" Margin="5,5,5,0"
                     ItemTemplate="{DynamicResource NameIdLsBxItem}">
                     <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                           <Style.Triggers>
                              <DataTrigger Binding="{Binding bIsActive}" Value="False">
                                 <Setter Property="Foreground" Value="{StaticResource OmagCut_White}"/>
                              </DataTrigger>
                           </Style.Triggers>
                        </Style>
                     </ListBox.ItemContainerStyle>
                  </ListBox>

                  <TextBlock Name="MinThicknessTxBl" Grid.Column="0" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="MinThicknessTxBx" Grid.Column="1" Grid.Row="1"
                     Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                  <TextBlock Name="MaxThicknessTxBl" Grid.Column="2" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="MaxThicknessTxBx" Grid.Column="3" Grid.Row="1"
                     Style="{DynamicResource OmagCut_MachRightCalculatorTextBoxInBorder}" />

               </Grid>
            </Border>


         </Grid>

         <!-- Definizione della Grid dei parametri dell'utensile associato alla lavorazione -->
         <Grid Grid.Column="2">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
               <RowDefinition Height="0.25*"/>
            </Grid.RowDefinitions>

            <TextBlock Name="ToolTxBl" Grid.Column="0" Grid.RowSpan="3"
               Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
            <ComboBox Name="ToolCmBx" Grid.Column="1" Grid.Row="0" Grid.RowSpan="3" Style="{StaticResource OmagCut_MachToolLeftComboBoxNoBorder}">
               <ComboBox.ItemTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                  </DataTemplate>
               </ComboBox.ItemTemplate>
            </ComboBox>

            <Grid Name="SpeedGrd" Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Grid.RowSpan="3">
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2*"/>
               </Grid.ColumnDefinitions>

               <TextBlock Name="SpeedTxBl" Grid.Column="0"
                  Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
               <EgtWPFLib:EgtTextBox Name="SpeedTxBx" Grid.Column="1"
                  Style="{DynamicResource OmagCut_MachToolCalculatorTextBox}" />

            </Grid>

            <GroupBox Name="FeedGpBx" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="2" Grid.RowSpan="14"
               Style="{DynamicResource OmagCut_GroupBox}">

               <Grid Name="FeedGrd">
                  <Grid.ColumnDefinitions>
                     <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*"/>
                  </Grid.RowDefinitions>

                  <TextBlock Name="FeedTxBl" Grid.Column="0" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="FeedTxBx" Grid.Column="1" Grid.Row="0" 
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}"/>

                  <TextBlock Name="TipFeedTxBl" Grid.Column="0" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="TipFeedTxBx" Grid.Column="1" Grid.Row="1"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="StartFeedTxBl" Grid.Column="0" Grid.Row="2" 
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="StartFeedTxBx" Grid.Column="1" Grid.Row="2"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="ThicknessFeedTxBl" Grid.Column="0" Grid.Row="2"  
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="ThicknessFeedTxBx" Grid.Column="1" Grid.Row="2" 
                                        Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="EndFeedTxBl" Grid.Column="0" Grid.Row="3"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="EndFeedTxBx" Grid.Column="1" Grid.Row="3"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="VertFeedTxBl" Grid.Column="0" Grid.Row="4"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="VertFeedTxBx" Grid.Column="1" Grid.Row="4"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="BackFeedTxBl" Grid.Column="0" Grid.Row="4"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="BackFeedTxBx" Grid.Column="1" Grid.Row="4"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="SideAngCutTxBl" Grid.Column="0" Grid.Row="5"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="SideAngCutTxBx" Grid.Column="1" Grid.Row="5"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

               </Grid>

            </GroupBox>

            <GroupBox Name="SpecificLeadInGpBx" Grid.Column="0" Grid.Row="22" Grid.ColumnSpan="2" Grid.RowSpan="7"
               Style="{DynamicResource OmagCut_GroupBox}">

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

                        <TextBlock Name="SpecificLenTxBl" Grid.Column="0" Grid.Row="0"
                            Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="SpecificLenTxBx" Grid.Column="1" Grid.Row="0" 
                            Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}"/>

                        <TextBlock Name="SpecificStepTxBl" Grid.Column="0" Grid.Row="1"
                            Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="SpecificStepTxBx" Grid.Column="1" Grid.Row="1"
                            Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />
                        
                    </Grid>

                </GroupBox>

            <GroupBox Name="OffsetGpBx" Grid.Column="0" Grid.Row="20" Grid.ColumnSpan="2" Grid.RowSpan="6"
               Style="{DynamicResource OmagCut_GroupBox}">

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

                  <TextBlock Name="RadOffsetTxBl" Grid.Column="0" Grid.Row="0"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="RadOffsetTxBx" Grid.Column="1" Grid.Row="0"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

                  <TextBlock Name="LonOffsetTxBl" Grid.Column="0" Grid.Row="1"
                     Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                  <EgtWPFLib:EgtTextBox Name="LonOffsetTxBx" Grid.Column="1" Grid.Row="1"
                     Style="{DynamicResource OmagCut_CalculatorTextBoxInGroupBox}" />

               </Grid>

            </GroupBox>

            <GroupBox Name="CornerGpBx" Grid.Column="0" Grid.Row="15" Grid.ColumnSpan="2" Grid.RowSpan="12" 
               Style="{DynamicResource OmagCut_GroupBox}">

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

                        <TextBlock Name="ExtCornTypeTxBl" Grid.Column="0" Grid.Row="0" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <ComboBox Name="ExtCornTypeCmBx" Grid.Column="1" Grid.Row="0" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Name="IntCornTypeTxBl" Grid.Column="0" Grid.Row="1" Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <ComboBox Name="IntCornTypeCmBx" Grid.Column="1" Grid.Row="1" Style="{StaticResource OmagCut_LeftComboBoxInBorder}">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" Style="{StaticResource OmagCut_LowerCaseCharacterTextBlock}"/>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Name="CornSlowLenTxBl" Grid.Column="0" Grid.Row="2" 
                                   Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="CornSlowLenTxBx" Grid.Column="1" Grid.Row="2" 
                                              Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="CornSlowPercTxBl" Grid.Column="0" Grid.Row="3" 
                                   Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="CornSlowPercTxBx" Grid.Column="1" Grid.Row="3" 
                                              Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                    </Grid>

            </GroupBox>

                <GroupBox Name="ProbingGpBx" Grid.Column="0" Grid.Row="27" Grid.ColumnSpan="2" Grid.RowSpan="9"
                    Style="{DynamicResource OmagCut_GroupBox}">

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

                        <TextBlock Name="ProbingTxBl" Grid.Row="0" Grid.Column="0"
                           Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <CheckBox Name="ProbingChBx" Grid.Row="0" Grid.Column="1" Style="{StaticResource OmagCut_CheckBox_Single}"/>

                        <TextBlock Name="ProbingMinDistTxBl" Grid.Column="0" Grid.Row="1"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="ProbingMinDistTxBx" Grid.Column="1" Grid.Row="1"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                        <TextBlock Name="ProbingMaxDistTxBl" Grid.Column="0" Grid.Row="2"
                             Style="{DynamicResource OmagCut_ToolsDBTextBlock}"/>
                        <EgtWPFLib:EgtTextBox Name="ProbingMaxDistTxBx" Grid.Column="1" Grid.Row="2"
                             Style="{DynamicResource OmagCut_MachLeftCalculatorTextBoxInBorder}" />

                    </Grid>

                </GroupBox>

            </Grid>

         <!-- Definizione della Grid inferiore per Button -->
         <Grid Name="LowerButtonGrid" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="1*"/>
               <ColumnDefinition Width="1*"/>
               <ColumnDefinition Width="1*"/>
               <ColumnDefinition Width="10*"/>
               <ColumnDefinition Width="1*"/>
               <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>

                <Button Name="NewBtn" Grid.Column="0" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
                <Button Name="SaveBtn" Grid.Column="1" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
                <Button Name="RemoveBtn" Grid.Column="2" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
                <Button Name="ExportBtn" Grid.Column="4" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}"/>
                <Button Name="ImportBtn" Grid.Column="5" Style="{DynamicResource OmagCut_YellowGradientYellowTextButton}" Padding="0"/>
            </Grid>

      </Grid>

   </Border>

</UserControl>
