<Grid x:Class="MachinePageV"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:Effector.Plugin.StoneCut"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="950" d:DesignWidth="1600">
   <Grid.Resources>
      <local:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
      <local:StringToMachineStateConverter x:Key="StringToMachineStateConverter"/>
      <local:StringToDDFCalcStateConverter x:Key="StringToDDFCalcStateConverter"/>
      <local:StringToNewDoorStateConverter x:Key="StringToNewDoorStateConverter"/>
      <local:StringToBooleanConverter x:Key="StringToBooleanConverter"/>
      <local:StringToBackgroundConverter x:Key="StringToBackgroundConverter"/>
      <local:DoorToVisibilityConverter x:Key="DoorToVisibilityConverter"/>
      <local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
   </Grid.Resources>
   <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="1*"/>
   </Grid.ColumnDefinitions>
   <!--Lista variabili-->
   <ItemsControl ItemsSource="{Binding VariableList}"
                 Visibility="{Binding VariableList_Visibility}">
      <ItemsControl.ItemTemplate>
         <DataTemplate>
            <Grid>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="150"/>
                  <ColumnDefinition Width="50"/>
               </Grid.ColumnDefinitions>
               <StackPanel Orientation="Horizontal">
                  <TextBlock Text="{Binding sName}"/>
                  <TextBlock Text=" ("/>
                  <TextBlock Text="{Binding sIndex}"/>
                  <TextBlock Text=")"/>
               </StackPanel>
               <TextBlock Grid.Column="1" 
                          Text="{Binding sValue}"/>
            </Grid>
         </DataTemplate>
      </ItemsControl.ItemTemplate>
   </ItemsControl>
   <Grid Grid.Column="1">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="Auto"/>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <TextBlock Grid.Column="0"
                    Grid.Row="0"
                    Text="DDF Calc State"/>
         <TextBlock Grid.Column="2"
                    Grid.Row="0"
                    Text="{Binding nDDfCalcState, Converter={StaticResource StringToDDFCalcStateConverter}}"/>
         <TextBlock Grid.Column="0"
                    Grid.Row="1"
                    Text="New Door State"/>
         <TextBlock Grid.Column="2"
                    Grid.Row="1"
                    Text="{Binding nNewDoorState, Converter={StaticResource StringToNewDoorStateConverter}}"/>
         <TextBlock Grid.ColumnSpan="2"
                    Grid.Row="2"
                    Text="Errore nella generazione programma!&#x0d;&#x0a;Verificare nel file di log!&#x0d;&#x0a;Chiudere il programma e riaprirlo dopo aver risolto!"
                    Visibility="{Binding bErrorReset, Converter={StaticResource BooleanToVisibilityConverter}}"/>
      </Grid>
      <Grid Grid.Row="1"
            VerticalAlignment="Center">
         <Grid.Resources>
         </Grid.Resources>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <!--Gestore macchina-->
         <Grid Grid.Column="1"
               Grid.Row="1"
               Visibility="{Binding MachineCommands_Visibility}">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="3.5*"/>
               <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="1">
               <Grid.RowDefinitions>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
                  <RowDefinition Height="1*"/>
               </Grid.RowDefinitions>
               <TextBlock Text="{Binding VariableList[5].sValue, Converter={StaticResource StringToMachineStateConverter}}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
               <Button Grid.Row="1"
                       Content="Initialize"
                       Command="{Binding WriteVariable_Command}"
                       CommandParameter="1,1,1352,1"
                       Style="{StaticResource Advancement_Button}"/>
               <StackPanel Grid.Row="2"
                           Orientation="Horizontal"
                           HorizontalAlignment="Center">
                  <Button Content="Start&#x0d;&#x0a;Machining"
                          Command="{Binding ManageMachining_Command}"
                          CommandParameter="1,1"
                          Style="{StaticResource Advancement_Button}"/>
                  <Button Content="End&#x0d;&#x0a;Machining"
                          Command="{Binding ManageMachining_Command}"
                          CommandParameter="1,2"
                          Style="{StaticResource Advancement_Button}"/>
               </StackPanel>
               <Grid Grid.Row="3"
                     HorizontalAlignment="Center">
                  <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="Auto"/>
                     <ColumnDefinition Width="Auto"/>
                  </Grid.ColumnDefinitions>
                  <Grid.RowDefinitions>
                     <RowDefinition Height="Auto"/>
                     <RowDefinition Height="Auto"/>
                  </Grid.RowDefinitions>
                  <TextBlock Grid.Column="0"
                             Grid.Row="0"
                             Text="Sent 1"/>
                  <CheckBox Grid.Column="1"
                            Grid.Row="0"
                            IsChecked="{Binding VariableList[3].sValue, Converter={StaticResource StringToBooleanConverter}}"
                            Style="{StaticResource MachDrawVar_CheckBox}"/>
                  <TextBlock Grid.Column="0"
                             Grid.Row="1"
                             Text="Sent 2"/>
                  <CheckBox Grid.Column="1"
                            Grid.Row="1"
                            IsChecked="{Binding VariableList[4].sValue, Converter={StaticResource StringToBooleanConverter}}"
                            Style="{StaticResource MachDrawVar_CheckBox}"/>
               </Grid>
            </Grid>
         </Grid>
         <!--Bottoni avanzamento-->
         <!--<Grid Grid.Column="1"
               Grid.Row="2"
               Visibility="{Binding MachineCommands_Visibility}">
            <Grid>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="3.8*"/>
                  <ColumnDefinition Width="18.7*"/>
                  <ColumnDefinition Width="3.8*"/>
               </Grid.ColumnDefinitions>
               <Button Content="Load Door&#x0d;&#x0a;On M1S0"
                       Command="{Binding WriteVariable_Command}"
                       CommandParameter="1,3,901.0,1;1,2,980,1"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="2"
                       Content="Unload Door&#x0d;&#x0a;From M2S4"
                       Command="{Binding WriteVariable_Command}"
                       CommandParameter="2,2,984,0;2,1,1364,0"
                       Style="{StaticResource Advancement_Button}"/>
            </Grid>
            <Grid>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="2.8*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="1.5*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="1.7*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="1.5*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2*"/>
                  <ColumnDefinition Width="2.8*"/>
               </Grid.ColumnDefinitions>
               <Button Grid.Column="1"
                       Content="Go To&#x0d;&#x0a;M1S1"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="1,1,1360/1,2,980;1,3,901.0->1,1,1361/1,2,981"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="2"
                       Content="Go To&#x0d;&#x0a;M1S2"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="1,1,1361/1,2,981->1,1,1362/1,2,982"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="4"
                       Content="Go To&#x0d;&#x0a;M1S3"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="1,1,1362/1,2,982->1,1,1363/1,2,983"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="5"
                       Content="Go To&#x0d;&#x0a;M1S4"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="1,1,1363/1,2,983->1,1,1364;2,1,1360/1,2,984;2,2,980"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="7"
                       Content="Go To&#x0d;&#x0a;M2S1"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="2,1,1360;1,1,1364/1,2,984;2,2,980->2,1,1361/2,2,981"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="8"
                       Content="Go To&#x0d;&#x0a;M2S2"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="2,1,1361/2,2,981->2,1,1362/2,2,982"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="10"
                       Content="Go To&#x0d;&#x0a;M2S3"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="2,1,1362/2,2,982->2,1,1363/2,2,983"
                       Style="{StaticResource Advancement_Button}"/>
               <Button Grid.Column="11"
                       Content="Go To&#x0d;&#x0a;M2S4"
                       Command="{Binding MoveVariable_Command}"
                       CommandParameter="2,1,1363/2,2,983->2,1,1364/2,2,984"
                       Style="{StaticResource Advancement_Button}"/>
            </Grid>
         </Grid>-->
         <!--Immagine macchina-->
         <Grid Grid.Column="1"
               Grid.Row="3">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="0.4*"/>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="0.14*"/>
            </Grid.ColumnDefinitions>
            <Image Grid.Column="1"
                   Source="{Binding sMachineImagePath}"
                   Stretch="Uniform"/>
         </Grid>
         <!--Intestazioni-->
         <Grid Grid.Row="3"
               Visibility="{Binding VariableOnDraw_Visibility}">
            <Grid.RowDefinitions>
               <RowDefinition Height="0.7*"/>
               <RowDefinition Height="0.3*"/>
               <RowDefinition Height="0.7*"/>
               <RowDefinition Height="0.6*"/>
               <RowDefinition Height="0.3*"/>
               <RowDefinition Height="0.6*"/>
               <RowDefinition Height="0.7*"/>
               <RowDefinition Height="0.3*"/>
               <RowDefinition Height="0.7*"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="1"
                       Text="Sensors"/>
            <TextBlock Grid.Row="4"
                       Text="Door Index"/>
            <TextBlock Grid.Row="7"
                       Text="Door Presence"/>
         </Grid>
         <!--TextBox variabili-->
            <!--<Grid Grid.Column="1"
                  Grid.Row="3">-->
         <Grid Grid.Column="1"
            Grid.Row="3"
            Visibility="{Binding VariableOnDraw_Visibility}">
               <Grid.ColumnDefinitions>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="1.7*"/>
               <RowDefinition Height="1.5*"/>
               <RowDefinition Height="1.7*"/>
            </Grid.RowDefinitions>
            <Border Grid.Column="0"
                    Grid.Row="1"
                    Style="{StaticResource Table}"/>
            <TextBlock Grid.Column="0"
                       Grid.Row="1"
                       Text="{Binding VariableList[6].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
            <TextBlock Grid.Column="0"
                       Grid.Row="2"
                       Text="{Binding VariableList[0].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
            <Border Grid.Column="1"
                    Grid.Row="1"
                    Style="{StaticResource Table}"/>
            <TextBlock Grid.Column="1"
                       Grid.Row="1"
                       Text="{Binding VariableList[7].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
            <TextBlock Grid.Column="1"
                       Grid.Row="2"
                       Text="{Binding VariableList[1].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
            <Border Grid.Column="2"
                    Grid.Row="1"
                    Style="{StaticResource Table}"/>
            <TextBlock Grid.Column="2"
                       Grid.Row="1"
                       Text="{Binding VariableList[8].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
            <TextBlock Grid.Column="2"
                       Grid.Row="2"
                       Text="{Binding VariableList[2].sValue}"
                       Style="{StaticResource MachDrawVar_TextBlock}"/>
         </Grid>
         <!--Sensori-->
         <Grid Grid.Column="1"
               Grid.Row="3">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="2*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="0.2*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="0.2*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="0.2*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="0.2*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="0.2*"/>
               <ColumnDefinition Width="0.4*"/>
               <ColumnDefinition Width="0.1*"/>
               <ColumnDefinition Width="1.5*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="1.7*"/>
               <RowDefinition Height="1.5*"/>
               <RowDefinition Height="1.7*"/>
            </Grid.RowDefinitions>
            <Ellipse Grid.Column="1"
                     Fill="{Binding VariableList[6].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
            <Ellipse Grid.Column="3"
                     Fill="{Binding VariableList[7].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
            <Ellipse Grid.Column="5"
                     Fill="{Binding VariableList[8].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
            <Ellipse Grid.Column="7"
                     Fill="{Binding VariableList[9].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
            <Ellipse Grid.Column="9"
                     Fill="{Binding VariableList[10].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
            <Ellipse Grid.Column="12"
                     Fill="{Binding VariableList[11].sValue, Converter={StaticResource StringToBackgroundConverter}}"
                     Style="{StaticResource Sensor}"/>
         </Grid>
         <!--Porte-->
         <Grid Grid.Column="1"
               Grid.Row="3">
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="0.7*"/>
               <ColumnDefinition Width="2.5*"/>
               <ColumnDefinition Width="0.3*"/>
               <ColumnDefinition Width="2.5*"/>
               <ColumnDefinition Width="0.3*"/>
               <ColumnDefinition Width="2.5*"/>
               <ColumnDefinition Width="0.7*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="1.9*"/>
               <RowDefinition Height="1.1*"/>
               <RowDefinition Height="1.9*"/>
            </Grid.RowDefinitions>
            <Border Grid.Column="1"
                    Grid.Row="1"
                    Visibility="{Binding VariableList[0].sValue, Converter={StaticResource StringToVisibilityConverter}}"
                    Style="{StaticResource Door}">
               <TextBlock Text="{Binding DoorOnMachineArray[0].nId}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
            </Border>
            <Border Grid.Column="3"
                    Grid.Row="1"
                    Visibility="{Binding VariableList[1].sValue, Converter={StaticResource StringToVisibilityConverter}}"
                    Style="{StaticResource Door}">
               <TextBlock Text="{Binding DoorOnMachineArray[1].nId}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
            </Border>
            <Border Grid.Column="5"
                    Grid.Row="1"
                    Visibility="{Binding VariableList[2].sValue, Converter={StaticResource StringToVisibilityConverter}}"
                    Style="{StaticResource Door}">
               <TextBlock Text="{Binding DoorOnMachineArray[2].nId}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
            </Border>
         </Grid>
         <!--Descrizione porte-->
         <ItemsControl Grid.Column="1"
                       Grid.Row="4"
                       ItemsSource="{Binding DoorOnMachineArray}">
            <ItemsControl.ItemsPanel>
               <ItemsPanelTemplate>
                  <UniformGrid Columns="3"/>
               </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
               <DataTemplate>
                  <Grid Visibility="{Binding Converter={StaticResource DoorToVisibilityConverter}}">
                     <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="1*"/>
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                     </Grid.RowDefinitions>
                     <TextBlock Grid.Column="0"
                                Grid.Row="0"
                                Text="Id"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="0"
                                Text="{Binding nId}"/>
                     <!--<TextBlock Grid.Column="0"
                                Grid.Row="1"
                                Text="Circular Index"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="1"
                                Text="{Binding nCircIndex}"/>-->
                     <TextBlock Grid.Column="0"
                                Grid.Row="2"
                                Text="State"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="2"
                                Text="{Binding nState}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="3"
                                Text="DDF Name"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="3"
                                Text="{Binding sDDFName}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="4"
                                Text="CSV Name"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="4"
                                Text="{Binding sCSVName}"/>
                     <!--<TextBlock Grid.Column="0"
                                Grid.Row="5"
                                Text="DoorCode"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="5"
                                Text="{Binding sDoorCode}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="6"
                                Text="DoorDescription"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="6"
                                Text="{Binding sDoorDescription}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="7"
                                Text="M1 CN Path"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="7"
                                Text="{Binding sM1CNPath}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="8"
                                Text="M2 CN Path"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="8"
                                Text="{Binding sM2CNPath}"/>-->
                     <TextBlock Grid.Column="0"
                                Grid.Row="9"
                                Text="Load Time"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="9"
                                Text="{Binding sLoadTime}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="10"
                                Text="Machining 1 Start"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="10"
                                Text="{Binding sMachining1Start}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="11"
                                Text="Machining 1 End"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="11"
                                Text="{Binding sMachining1End}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="12"
                                Text="Machining 2 Start"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="12"
                                Text="{Binding sMachining2Start}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="13"
                                Text="Machining 2 End"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="13"
                                Text="{Binding sMachining2End}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="14"
                                Text="UnloadTime"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="14"
                                Text="{Binding sUnloadTime}"/>
                  </Grid>
               </DataTemplate>
            </ItemsControl.ItemTemplate>
         </ItemsControl>
      </Grid>
      <!--Lista circolare porte-->
      <Grid Grid.Row="2"
            Visibility="{Binding DoorCircList_Visibility}">
         <ItemsControl ItemsSource="{Binding LuaDoorList}">
            <ItemsControl.ItemsPanel>
               <ItemsPanelTemplate>
                  <UniformGrid Columns="10"/>
               </ItemsPanelTemplate>
            </ItemsControl.ItemsPanel>
            <ItemsControl.ItemTemplate>
               <DataTemplate>
                  <Grid>
                     <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="1*"/>
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                     </Grid.RowDefinitions>
                     <TextBlock Grid.Column="0"
                                Grid.Row="0"
                                Text="Id"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="0"
                                Text="{Binding nId}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="1"
                                Text="Circular Index"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="1"
                                Text="{Binding nCircIndex}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="2"
                                Text="State"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="2"
                                Text="{Binding nState}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="3"
                                Text="DDF Name"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="3"
                                Text="{Binding sDDFName}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="4"
                                Text="CSV Name"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="4"
                                Text="{Binding sCSVName}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="5"
                                Text="DoorCode"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="5"
                                Text="{Binding sDoorCode}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="6"
                                Text="DoorDescription"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="6"
                                Text="{Binding sDoorDescription}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="7"
                                Text="M1 CN Path"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="7"
                                Text="{Binding sM1CNPath}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="8"
                                Text="M2 CN Path"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="8"
                                Text="{Binding sM2CNPath}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="9"
                                Text="Load Time"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="9"
                                Text="{Binding sLoadTime}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="10"
                                Text="Machining 1 Start"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="10"
                                Text="{Binding sMachining1Start}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="11"
                                Text="Machining 1 End"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="11"
                                Text="{Binding sMachining1End}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="12"
                                Text="Machining 2 Start"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="12"
                                Text="{Binding sMachining2Start}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="13"
                                Text="Machining 2 End"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="13"
                                Text="{Binding sMachining2End}"/>
                     <TextBlock Grid.Column="0"
                                Grid.Row="14"
                                Text="UnloadTime"/>
                     <TextBlock Grid.Column="1"
                                Grid.Row="14"
                                Text="{Binding sUnloadTime}"/>
                  </Grid>
               </DataTemplate>
            </ItemsControl.ItemTemplate>
         </ItemsControl>
      </Grid>
   </Grid>
</Grid>
