<Grid x:Class="OnlyProdCheckVersionV"
      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:EgtBEAMWALL.ViewerOptimizer"
      xmlns:EgtBEAMWALLCORE="clr-namespace:EgtBEAMWALL.Core;assembly=EgtBEAMWALL.Core"
      xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
      xmlns:WebView="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf">
   <Grid.Resources>
      <EgtBEAMWALL:IsPermittedConverter x:Key="IsPermittedConverter"/>
   </Grid.Resources>

   <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="1*"/>
   </Grid.ColumnDefinitions>
   <Grid Margin="10" 
         VerticalAlignment="Top" 
         HorizontalAlignment="Left">
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="1*"/>
      </Grid.RowDefinitions>
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
         <TextBlock Text="{Binding ActVersion_Msg}"
                    VerticalAlignment="Center"
                    FontSize="15"
                    FontWeight="Bold"
                    Margin="10,0,0,0"
                    Style="{StaticResource OptionTextBlock_OnlyProd}"/>
         <TextBlock Text="{Binding ActualVersion}"
                    VerticalAlignment="Center"
                    FontSize="15"
                    FontWeight="Bold"
                    Margin="10,0,0,0"
                    Style="{StaticResource OptionTextBlock_OnlyProd}"/>
      </StackPanel>
      <UniformGrid Grid.Row="1"
                   Columns="2"
                   Margin="0,20,0,10">
         <Button Content="{Binding AllVersion_Msg}"
                 Width="180"
                 Command="{Binding GetAllReleaseCommand}"
                 Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
         <Button Content="{Binding VersionFrom_Msg}"
                 Width="150"
                 Command="{Binding GetVersionFromCommand}"
                 Style="{StaticResource OnlyProdEgtWPFLib5_InputButton}"/>
      </UniformGrid>
      <Border Grid.Row="2" 
              Margin="0,10,10,10"  
              Visibility="{Binding ProgramVersionListVisibility}"
              Style="{StaticResource OnlyProdPage_Border}">
         <DataGrid ItemsSource="{Binding ProgramVersionList}"
                   SelectedItem="{Binding ProgramVersionListItem}"
                   AutoGenerateColumns="False"
                   CanUserSortColumns="False"
                   CanUserResizeColumns="False"
                   CanUserResizeRows="False"
                   CanUserReorderColumns="False"
                   SelectionMode="Single"
                   ScrollViewer.CanContentScroll="True" 
                   ScrollViewer.VerticalScrollBarVisibility="Auto"
                   ScrollViewer.HorizontalScrollBarVisibility="Hidden"
                   AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
                   AlternationCount="2"
                   CellStyle="{StaticResource CellDataGrid_CustomHighLight}"
                   RowStyle="{StaticResource RowDataGrid_CustomHighLight}"
                   Style="{StaticResource DataGrid_OnlyProd}">
            <DataGrid.ColumnHeaderStyle>
               <Style TargetType="{x:Type DataGridColumnHeader}">
                  <Setter Property="Background" Value="{StaticResource BeamWall_Teal}"/>
                  <Setter Property="Foreground" Value="{StaticResource BeamWall_White}"/>
                  <Setter Property="HorizontalContentAlignment" Value="Center"/>
                  <Setter Property="FontWeight" Value="Bold"/>
                  <Setter Property="FontSize" Value="15"/>
               </Style>
            </DataGrid.ColumnHeaderStyle>
            <DataGrid.Columns>
               <!--Numero Versione-->
               <DataGridTemplateColumn Width="170">
                  <DataGridTemplateColumn.HeaderTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding DataContext.NumVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.HeaderTemplate>
                  <DataGridTemplateColumn.CellTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding VersNum}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.CellTemplate>
               </DataGridTemplateColumn>
               <!--Versione-->
               <DataGridTemplateColumn Width="110">
                  <DataGridTemplateColumn.HeaderTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding DataContext.Version_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.HeaderTemplate>
                  <DataGridTemplateColumn.CellTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding VersText}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.CellTemplate>
               </DataGridTemplateColumn>
               <!--Data di Rilascio-->
               <DataGridTemplateColumn Width="160">
                  <DataGridTemplateColumn.HeaderTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding DataContext.DateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.HeaderTemplate>
                  <DataGridTemplateColumn.CellTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding ReleaseDate, StringFormat=dd/MM/yyyy}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.CellTemplate>
               </DataGridTemplateColumn>
               <!--Stato Versione-->
               <DataGridTemplateColumn Width="150">
                  <DataGridTemplateColumn.HeaderTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding DataContext.StateVersion_Msg, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.HeaderTemplate>
                  <DataGridTemplateColumn.CellTemplate>
                     <DataTemplate>
                        <TextBlock Text="{Binding Converter={StaticResource IsPermittedConverter}}"/>
                     </DataTemplate>
                  </DataGridTemplateColumn.CellTemplate>
               </DataGridTemplateColumn>
            </DataGrid.Columns>
         </DataGrid>
      </Border>
   </Grid>
   <Border Grid.Column="1" 
           Margin="0,10,10,10"  
           Style="{StaticResource OnlyProdPage_Border}">
      <WebView:WebView2 Grid.Column="1"
                        Source="{Binding LinkVersionView}"/>
   </Border>

</Grid>
