<Grid x:Class="OnlyProdMachine_ConfigurationPageV"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Core"
      xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">

   <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto"/>
      <ColumnDefinition Width="1*"/>
   </Grid.ColumnDefinitions>
   <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="10*"/>
   </Grid.RowDefinitions>

   <StackPanel Orientation="Horizontal">
      <GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
         <EgtBEAMWALL:OnlyProdMachinePanelV DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
      </GroupBox>
   </StackPanel>

   <StackPanel Grid.Row="1" Orientation="Horizontal" Visibility="{Binding MachineParameter_Visibility}">
      <ItemsControl ItemsSource="{Binding ConfigMachTableList}">
         <ItemsControl.ItemsPanel>
            <ItemsPanelTemplate>
               <StackPanel x:Name="GroupStackPanel" Orientation="Horizontal"/>
            </ItemsPanelTemplate>
         </ItemsControl.ItemsPanel>
         <ItemsControl.ItemTemplate>
            <DataTemplate>
               <GroupBox Header="{Binding sName}" Width="Auto" VerticalAlignment="Top" Height="Auto" Foreground="{StaticResource BeamWall_Corduroy}">
                  <ItemsControl Name="MachParamsItemsControl" ItemsSource="{Binding MachParamList}" Margin="0,5,0,0">
                     <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                           <WrapPanel Orientation="Vertical"/>
                        </ItemsPanelTemplate>
                     </ItemsControl.ItemsPanel>
                     <ItemsControl.ItemTemplate>
                        <DataTemplate>
                           <Grid Margin="0,0,5,5">
                              <Grid.ColumnDefinitions>
                                 <ColumnDefinition Width="*" />
                                 <ColumnDefinition Width="*" />
                                 <ColumnDefinition Width="*" />
                              </Grid.ColumnDefinitions>
                              <TextBlock Text="{Binding sName}"
                                         ToolTip="{Binding sName}"
                                         TextWrapping="WrapWithOverflow"
                                         Width="150"
                                         Style="{StaticResource MachParamTextBlock}"/>
                              <EgtWPFLib5:EgtTextBox Grid.Column="1"
                                                     Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
                                                     Width="60"/>
                              <TextBlock Grid.Column="2"
                                         Text="{Binding sDescription}"
                                         ToolTip="{Binding sDescription}"
                                         TextWrapping="WrapWithOverflow"
                                         Width="148"
                                         Style="{StaticResource MachParamTextBlock}"/>
                           </Grid>
                        </DataTemplate>
                     </ItemsControl.ItemTemplate>
                  </ItemsControl>
               </GroupBox>
            </DataTemplate>
         </ItemsControl.ItemTemplate>
      </ItemsControl>
   </StackPanel>

   <Button Grid.Row="1"
           Command="{Binding SaveCommand}"
           ToolTip="{Binding SaveToolTip}"
           Visibility="{Binding Machine_Visibility}"
           Style="{StaticResource SaveMachinePanel_Button}">
      <Image Source="/Resources/ProjectManager/Save.png" Stretch="Uniform"/>
   </Button>

</Grid>
