<EgtWPFLib5:EgtCustomWindow x:Class="OnlyProdOpenProjectFileDialogV"
                            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.Core"
                            Title="{Binding Title}"
                            Style="{StaticResource OnlyProd_EgtCustomWindow}"
                            WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="True"
                            IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
                            MinHeight="500" MinWidth="500"
                            DataContext="{Binding RelativeSource={RelativeSource Self}}">

   <EgtWPFLib5:EgtCustomWindow.Resources>
      <EgtWPFLib5:FileNameConverter x:Key="FileNameConverter"/>
   </EgtWPFLib5:EgtCustomWindow.Resources>

   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="5*"/>
         <RowDefinition Height="1*"/>
      </Grid.RowDefinitions>

      <GroupBox Header="Filters"
                Margin="5"
                Visibility="{Binding Filters_Visibility}"
                BorderBrush="{StaticResource BeamWall_RegentStBlue}">
         <Grid>
            <Grid.RowDefinitions>
               <RowDefinition Height="Auto"/>
               <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid>
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition Width="1*"/>
               </Grid.ColumnDefinitions>
               <ComboBox ItemsSource="{Binding BTLDateTypeList}"
                         SelectedIndex="{Binding SelBTLDateType}"
                         Width="105"
                         Margin="5"
                         Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
               <StackPanel Grid.Column="1" Orientation="Horizontal">
                  <ComboBox ItemsSource="{Binding DayTypeList}"
                            SelectedIndex="{Binding SelDayType}"
                            Width="105"
                            Margin="0,0,2.5,0"
                            Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
                  <StackPanel Orientation="Horizontal" Visibility="{Binding Date_Visibility}">
                     <TextBlock Text="{Binding From_Msg}"
                                Style="{StaticResource Filter_TextBlock}"
                                Foreground="{StaticResource BeamWall_Corduroy}"/>
                     <DatePicker SelectedDate="{Binding dtStartDate}"
                                 Style="{StaticResource Filter_DatePicker}"
                                 CalendarStyle="{StaticResource Filter_Calendar}"/>
                     <TextBlock Text="{Binding To_Msg}"
                                Style="{StaticResource Filter_TextBlock}"
                                Foreground="{StaticResource BeamWall_Corduroy}"/>
                     <DatePicker SelectedDate="{Binding dtEndDate}"
                                 Style="{StaticResource Filter_DatePicker}"
                                 CalendarStyle="{StaticResource Filter_Calendar}"/>
                  </StackPanel>
               </StackPanel>
            </Grid>
            <Grid Grid.Row="1">
               <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="Auto"/>
                  <ColumnDefinition Width="1*"/>
                  <ColumnDefinition Width="Auto"/>
               </Grid.ColumnDefinitions>
               <ComboBox ItemsSource="{Binding FilterTypeList}"
                         SelectedItem="{Binding SelFilterType}"
                         Width="105"
                         Margin="5"
                         Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
               <EgtWPFLib5:EgtTextBox Grid.Column="1"
                                      Text="{Binding SearchText}"
                                      Margin="5"
                                      Visibility="{Binding SearchText_Visibility}"
                                      Style="{StaticResource NewSearchText_TextBox}"/>
               <StackPanel Grid.Column="2" 
                           Orientation="Horizontal">
                  <TextBlock Text="Rows"
                             Style="{StaticResource OptionTextBlock}"
                             Foreground="{StaticResource BeamWall_Corduroy}"/>
                  <ComboBox ItemsSource="{Binding RowQuantityList}"
                            SelectedIndex="{Binding SelRowQuantity}"
                            Width="55"
                            Style="{StaticResource OnlyProdCalcPanel_ComboBox}"/>
               </StackPanel>
            </Grid>
         </Grid>
      </GroupBox>

      <Border Grid.Row="1" Style="{StaticResource OnlyProdPage_Border}" Margin="1"/>
      
      <EgtBEAMWALL:EgtDataGrid Grid.Row="1"
                               ItemsSource="{Binding ProjectList}" 
                               SelectedItem="{Binding SelProject}"
                               SelectionMode="Single"
                               Margin="5"
                               BindingColumns="{Binding ProjectColumns}"
                               AlternatingRowBackground="{StaticResource BeamWall_LinkWater}"
                               AlternationCount="2"
                               ColumnHeaderBackground="{StaticResource BeamWall_Teal}"
                               ColumnHeaderForeground="{StaticResource BeamWall_White}"
                               ColumnHeaderHorizontalContentAlignment="Center"
                               ColumnHeaderFontWeight="Bold"
                               ColumnHeaderFontSize="15"
                               ColumnHeaderPadding="0,2,0,2"
                               Style="{StaticResource DataGrid_OnlyProd}"
                               CellStyle="{StaticResource CellDataGrid_CustomHighLight}">
         <DataGrid.RowStyle>
            <Style TargetType="{x:Type DataGridRow}" BasedOn="{StaticResource RowDataGrid_CustomHighLight}">
               <Setter Property="IsEnabled" Value="{Binding bIsEnabled}"/>
               <EventSetter Event="MouseDoubleClick" Handler="ProjectList_MouseDoubleClick"/>
            </Style>
         </DataGrid.RowStyle>
         <DataGrid.Resources>
            <!-- ProjId -->
            <DataGridTextColumn x:Key="colPROJID" Binding="{Binding sProjId}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- ProdId -->
            <DataGridTextColumn x:Key="colPRODID" Binding="{Binding sProdId}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.Id_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- Project Name -->
            <DataGridTextColumn x:Key="colPROJNAME" Binding="{Binding sDescription}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- BTL FileName -->
            <DataGridTextColumn x:Key="colBTLNAME" Binding="{Binding sBTLFileName}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.BTLFileName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- ListName -->
            <DataGridTextColumn x:Key="colLISTNAME" Binding="{Binding sListName}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.ListName_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- Exported date -->
            <DataGridTextColumn x:Key="colEXPDATE" Binding="{Binding dtExportDate}">
               <DataGridTextColumn.HeaderTemplate>
                  <DataTemplate>
                     <TextBlock Text="{Binding Path=DataContext.ExportDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
                  </DataTemplate>
               </DataGridTextColumn.HeaderTemplate>
            </DataGridTextColumn>
            <!-- Creation date -->
            <DataGridTextColumn x:Key="colCRTDATE" Binding="{Binding dtCreateDate}">
               <DataGridTextColumn.Header>
                  <TextBlock Text="{Binding Path=DataContext.CreateDate_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
               </DataGridTextColumn.Header>
            </DataGridTextColumn>
            <!-- Machine -->
            <DataGridTextColumn x:Key="colMACHINE" Binding="{Binding sMachine}">
               <DataGridTextColumn.Header>
                  <TextBlock Text="{Binding Path=DataContext.Machine_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
               </DataGridTextColumn.Header>
            </DataGridTextColumn>
            <!-- Name (per Prod) -->
            <DataGridTextColumn x:Key="colNAME" Binding="{Binding sName}">
               <DataGridTextColumn.Header>
                  <TextBlock Text="{Binding Path=DataContext.Name_Msg,RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdOpenProjectFileDialogV}}}"/>
               </DataGridTextColumn.Header>
            </DataGridTextColumn>
         </DataGrid.Resources>
      </EgtBEAMWALL:EgtDataGrid>

      <UniformGrid Columns="3" Grid.Row="2" Margin="0,0,0,5">
         <Button IsDefault="True" Name="OpenBtn"
                 Content="{Binding Open_Msg}" 
                 Style="{DynamicResource OnlyProdEgtWPFLib5_InputButton}"/>
         <Button Content="{Binding Delete_Msg}"
                 Command="{Binding Delete_Command}"
                 Style="{DynamicResource OnlyProdEgtWPFLib5_InputButton}"/>
         <Button IsCancel="True"
                 Content="{Binding Cancel_Msg}" 
                 Style="{DynamicResource OnlyProdEgtWPFLib5_InputButton}"/>
      </UniformGrid>

   </Grid>

</EgtWPFLib5:EgtCustomWindow>
