<Grid x:Class="Machine_ConfigurationPageV"
      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:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5">

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

   <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
      <GroupBox Style="{StaticResource GroupBoxStyle_NoHeader}" Padding="5,10,5,5">
         <EgtBEAMWALL:MachinePanelV  DataContext="{Binding MachinePanelVM}" VerticalAlignment="Center"/>
      </GroupBox>
   </StackPanel>

   <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
      <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">
                  <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}"
                                         TextWrapping="WrapWithOverflow"
                                         Width="100"
                                         Style="{StaticResource MachParamTextBlock}"/>
                              <EgtWPFLib5:EgtTextBox Text="{Binding sValue, UpdateSourceTrigger=Explicit}"
                                                     Grid.Column="1"
                                                     Width="70"/>
                              <TextBlock Text="{Binding sDescription}"
                                         TextWrapping="WrapWithOverflow"
                                         Width="200"
                                         Style="{StaticResource MachParamTextBlock}"
                                         Grid.Column="2"/>
                           </Grid>
                        </DataTemplate>
                     </ItemsControl.ItemTemplate>
                  </ItemsControl>
               </GroupBox>
            </DataTemplate>
         </ItemsControl.ItemTemplate>
      </ItemsControl>
   </StackPanel>

</Grid>
