<UserControl x:Class="OnlyProdFeatureInPartInRawPartListV"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer" 
             xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core">

   <EgtBEAMWALLCORE:EgtDataGrid ItemsSource="{Binding Tag.FeatureVMList,
                                                      RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV}}}"
                                SelectedItem="{Binding Tag.SelFeatureVM,
                                                       RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV}}}"
                                SelectionMode="Single"
                                Margin="0,0,0,5"
                                BindingColumns="{Binding FeatureInPartInRawPartColumns}"
                                BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
                                AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
                                AlternationCount="2"
                                ColumnHeaderBackground="{StaticResource BeamWall_NeonCarrot}"
                                ColumnHeaderForeground="{StaticResource BeamWall_White}"
                                ColumnHeaderHorizontalContentAlignment="Center"
                                ColumnHeaderFontWeight="Bold"
                                ColumnHeaderFontSize="15"
                                ColumnHeaderPadding="0,2,0,2"
                                CellStyle="{StaticResource CellDataGrid_CustomHighLight_PartList}"
                                Style="{StaticResource DataGrid_OnlyProd}">

      <DataGrid.InputBindings>
         <KeyBinding Key="Delete" Command="{Binding Tag.SelFeatureVM.DeleteFeature_Command,
                                                    RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV}}}"/>
      </DataGrid.InputBindings>
      <DataGrid.Resources>
         <DataGridTemplateColumn x:Key="colDO">
            <DataGridTemplateColumn.HeaderTemplate>
               <DataTemplate>
                  <CheckBox IsChecked="{Binding Path=Tag.bDOALL, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdFeatureInPartInRawPartListV}}}"
                            Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
               </DataTemplate>
            </DataGridTemplateColumn.HeaderTemplate>
            <DataGridTemplateColumn.CellTemplate>
               <DataTemplate>
                  <CheckBox IsChecked="{Binding bDO, UpdateSourceTrigger=PropertyChanged}"
                            Style="{StaticResource OnlyProdFeatureInPartInRawPartList_CheckBox}"/>
               </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
         </DataGridTemplateColumn>
         <!--Validità feature-->
         <DataGridTemplateColumn x:Key="colCALC">
            <DataGridTemplateColumn.CellTemplate>
               <DataTemplate>
                  <Grid>
                     <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"/>
                        <ColumnDefinition Width="10"/>
                     </Grid.ColumnDefinitions>
                     <Border Width="{Binding ActualHeight, RelativeSource={RelativeSource self}}"
                             Background="{Binding Calc_Background}"/>
                     <Grid Grid.Column="1"
                           HorizontalAlignment="Center">
                        <Grid.RowDefinitions>
                           <RowDefinition Height="1*"/>
                           <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Ellipse Visibility="{Binding CALC_ROT_Visibility}"
                                 Style="{StaticResource OnlyProdFeatureInPartInRawPartList_Ellipse}"/>
                        <TextBlock Grid.Row="1"
                                   Text="{Binding CALC_ERR_Letter}"
                                   Foreground="{Binding CALC_ERR_Foreground}"
                                   Style="{StaticResource OnlyProdFeatureInPartInRawPartList_TextBlock}"/>
                     </Grid>
                  </Grid>
               </DataTemplate>
            </DataGridTemplateColumn.CellTemplate>
         </DataGridTemplateColumn>
         <!--Descrizione-->
         <DataGridTextColumn x:Key="colDESC" Binding="{Binding sDesc}">
            <DataGridTextColumn.HeaderTemplate>
               <DataTemplate>
                  <TextBlock Text="{Binding DataContext.Description_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
               </DataTemplate>
            </DataGridTextColumn.HeaderTemplate>
         </DataGridTextColumn>
         <!--Descrizione-->
         <DataGridTextColumn x:Key="colPRIORITY" Binding="{Binding sPriority}">
            <DataGridTextColumn.HeaderTemplate>
               <DataTemplate>
                  <TextBlock Text="{Binding DataContext.Priority_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
               </DataTemplate>
            </DataGridTextColumn.HeaderTemplate>
         </DataGridTextColumn>
      </DataGrid.Resources>

   </EgtBEAMWALLCORE:EgtDataGrid>

</UserControl>
