<EgtWPFLib5:EgtCustomWindow x:Class="UpdateBTLWndV"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
                            xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
                            xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
                            Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
                            WindowStyle="None" ResizeMode="NoResize"
                            SizeToContent="WidthAndHeight"
                            WindowStartupLocation="CenterOwner"
                            IsClosable="False"
                            IsMinimizable="False"
                            IsResizable="False"
                            Title="UpdateBTLWnd">
   <StackPanel Margin="5,5,5,0">

      <TextBlock Grid.Row="0" 
                 Text="{Binding UpdateBTLWnd_Msg}" 
                 TextWrapping="Wrap"
                 Width="400"
                 Margin="5"/>

      <EgtBEAMWALLCORE:EgtDataGrid Grid.Row="1" Width="400" MaxHeight="600"
                                   ItemsSource="{Binding BTLPartList}" 
                                   SelectedItem="{Binding SelBTLPart}"
                                   CanUserAddRows="False"
                                   AutoGenerateColumns="False"
                                   CanUserResizeRows="False"
                                   SelectionMode="Single"
                                   ScrollViewer.CanContentScroll="False" 
                                   ScrollViewer.VerticalScrollBarVisibility="Auto"
                                   ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                   Margin="5"
                                   BindingColumns="{Binding UpdateBTLColumns}">
         <DataGrid.Resources>
            <!-- PDN -->
            <DataGridTextColumn x:Key="colPDN" Binding="{Binding nPDN}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.PDN_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:UpdateBTLWndV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- Descrizione -->
            <DataGridTextColumn x:Key="colNAM" Binding="{Binding sNAM}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.NAM_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:UpdateBTLWndV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- Insert -->
            <DataGridTemplateColumn x:Key="colOVERWRITE">
               <DataGridTemplateColumn.Header>
                  <TextBlock Text="{Binding Path=DataContext.Insert_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:UpdateBTLWndV}}}"/>
               </DataGridTemplateColumn.Header>
               <DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <Ellipse Width="5"
                              Height="5"
                              Fill="Red"
                              Visibility="{Binding Overwrite_Visibility}" 
                              HorizontalAlignment="Center"/>
                  </DataTemplate>
               </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
            <!-- Insert -->
            <DataGridTemplateColumn x:Key="colINSERT">
               <DataGridTemplateColumn.Header>
                  <TextBlock Text="{Binding Path=DataContext.Insert_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:UpdateBTLWndV}}}"/>
               </DataGridTemplateColumn.Header>
               <DataGridTemplateColumn.CellTemplate>
                  <DataTemplate>
                     <CheckBox IsChecked="{Binding Path=bInsert, UpdateSourceTrigger=PropertyChanged}" 
                               HorizontalAlignment="Center"/>
                  </DataTemplate>
               </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>
         </DataGrid.Resources>
      </EgtBEAMWALLCORE:EgtDataGrid>

      <Grid Grid.Row="2" Margin="0,0,0,5">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
         </Grid.ColumnDefinitions>
         <Button Content="{Binding Ok_Msg}"
                 Command="{Binding Ok_Command}"
                 IsDefault="True"
                 Grid.Column="1"
                 Style="{StaticResource EgtWPFLib5_InputButton}"/>
         <Button Content="{Binding Cancel_Msg}"
                 Command="{Binding Cancel_Command}"
                 IsCancel="True"
                 Grid.Column="3"
                 Style="{StaticResource EgtWPFLib5_InputButton}"/>
      </Grid>

   </StackPanel>
</EgtWPFLib5:EgtCustomWindow>
