<Window x:Class="RestartWndV"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Effector.Plugin.StoneCut"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
   <Window.Resources>
      <local:StringToVisibilityConverter x:Key="StringToVisibilityConverter"/>
      <local:DoorToVisibilityConverter x:Key="DoorToVisibilityConverter"/>
      <local:StateToVisibilityConverter x:Key="StateToVisibilityConverter"/>
   </Window.Resources>
   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="1*"/>
         <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid>
         <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
         <Image Source="{Binding sMachineImagePath}"
                Stretch="Uniform"/>
         <!--Porte-->
         <Grid>
            <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.3*"/>
               <ColumnDefinition Width="2.5*"/>
               <ColumnDefinition Width="0.3*"/>
               <ColumnDefinition Width="2.5*"/>
               <ColumnDefinition Width="0.7*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
               <RowDefinition Height="2.15*"/>
               <RowDefinition Height="0.6*"/>
               <RowDefinition Height="2.15*"/>
            </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>
            <Border Grid.Column="7"
                    Grid.Row="1"
                    Visibility="{Binding VariableList[3].sValue, Converter={StaticResource StringToVisibilityConverter}}"
                    Style="{StaticResource Door}">
               <TextBlock Text="{Binding DoorOnMachineArray[3].nId}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
            </Border>
            <Border Grid.Column="9"
                    Grid.Row="1"
                    Visibility="{Binding VariableList[4].sValue, Converter={StaticResource StringToVisibilityConverter}}"
                    Style="{StaticResource Door}">
               <TextBlock Text="{Binding DoorOnMachineArray[4].nId}"
                          Style="{StaticResource MachDrawVar_TextBlock}"/>
            </Border>
         </Grid>
         <!--Descrizione porte-->
         <ItemsControl Grid.Row="1"
                       ItemsSource="{Binding DoorOnMachineArray}">
            <ItemsControl.ItemsPanel>
               <ItemsPanelTemplate>
                  <UniformGrid Columns="5"/>
               </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"/>
                     <TextBox 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>
      <!--<ItemsControl ItemsSource="{Binding RestartDoorList}">
         <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
               <UniformGrid Rows="1"/>
            </ItemsPanelTemplate>
         </ItemsControl.ItemsPanel>
         <ItemsControl.ItemTemplate>
            <DataTemplate>
               <Grid Visibility="{Binding nState, Converter={StaticResource StateToVisibilityConverter}}">
                  <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>
                  <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}"/>
                  <ComboBox Grid.Column="1"
                            Grid.Row="2"
                            ItemsSource="{Binding DoorStateList}"
                            SelectedItem="{Binding SelDoorState}"/>
                  <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 Text="Id"/>
               </Grid>
            </DataTemplate>
         </ItemsControl.ItemTemplate>
      </ItemsControl>-->
      <Button Grid.Row="1"
              Content="Ok"
              Command="{Binding Ok_Command}"/>
   </Grid>
</Window>
