<EgtFloating:EgtFloatingManager x:Class="OnlyProdProjectV"
                                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                xmlns:EgtFloating="clr-namespace:EgtWPFLib5.EgtFloating;assembly=EgtWPFLib5"
                                xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
                                DataContext="{StaticResource ProjectVM}">

   <EgtFloating:EgtFloatingTray x:Name="PROJECTTOPTRAY" DockPanel.Dock="Top" Background="{StaticResource BeamWall_RegentStBlue}">
      <Grid>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="1*"/>
         </Grid.ColumnDefinitions>
         <EgtBEAMWALL:OnlyProdManagerV DataContext="{StaticResource OnlyProdManagerVM}" HorizontalAlignment="Center"
                                       Visibility="{Binding DataContext.OnlyProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
                                       Margin="0,10,0,10" />
         <EgtBEAMWALL:OnlyProdOptimizePanelV Grid.Column="1"
                                             DataContext="{StaticResource OptimizePanelVM}"
                                             Visibility="{Binding DataContext.OnlyProdOptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
                                             Margin="40,10,0,10"/>
         <EgtBEAMWALL:OnlyProdStatisticsTimePanelV Grid.Column="2"
                                                   DataContext="{StaticResource StatisticsTimePanelVM}"
                                                   Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
                                                   Margin="150,10,0,10"/>
      </Grid>
   </EgtFloating:EgtFloatingTray>

   <Grid>
      <Grid.RowDefinitions>
         <RowDefinition Height="{Binding GridDims[0].GridLen, Mode=TwoWay}"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
      </Grid.RowDefinitions>
      <Grid>
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{Binding GridDims[2].GridLen, Mode=TwoWay}"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="{Binding GridDims[3].GridLen, Mode=TwoWay}"/>
         </Grid.ColumnDefinitions>
         <EgtBEAMWALL:OnlyProdLeftPanelV DataContext="{StaticResource LeftPanelVM}"
                                         Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"
                                         Visibility="{Binding DataContext.OnlyProdLeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
         
         <GridSplitter Grid.Column="1"
                       Style="{StaticResource Width_GridSplitter}"
                       Background="Transparent"/>
         
         <Grid Grid.Column="2">
            <Grid.RowDefinitions>
               <RowDefinition Height="Auto"/>
               <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
               <ColumnDefinition Width="1*"/>
               <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <WrapPanel Width="{Binding ActualWidth, ElementName=TOPTRAY}"
                       Style="{StaticResource OnlyProdProject_WrapPanel}">
               <EgtBEAMWALL:OnlyProdShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
               <EgtBEAMWALL:OnlyProdShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
                                                   Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
               <EgtBEAMWALL:OnlyProdViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
               <EgtBEAMWALL:OnlyProdInstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
               <EgtBEAMWALL:OnlyProdCalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
               <EgtBEAMWALL:OnlyProdSpecialPanelV DataContext="{StaticResource SpecialPanelVM}"
                                                  Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
               <EgtBEAMWALL:OnlyProdFreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
                                                        Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
            </WrapPanel>
            
            <EgtBEAMWALL:SceneHostV Grid.Row="1"/>

         </Grid>
      </Grid>

      <GridSplitter Grid.Row="1" 
                    Style="{StaticResource Height_GridSplitter}"/>

      <Grid Grid.Row="2">
         <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{Binding GridDims[4].GridLen, Mode=TwoWay}"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="{Binding GridDims[5].GridLen, Mode=TwoWay}"/>
         </Grid.ColumnDefinitions>

         <EgtBEAMWALL:ProdProjManagerV Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>

         <GridSplitter Grid.Column="1"
                       Style="{StaticResource Width_GridSplitter}"/>

         <Grid Grid.Column="2">
            <Grid.RowDefinitions>
               <RowDefinition Height="{Binding GridDims[6].GridLen, Mode=TwoWay}"/>
               <RowDefinition Height="Auto"/>
               <RowDefinition Height="{Binding GridDims[7].GridLen, Mode=TwoWay}"/>
            </Grid.RowDefinitions>

            <EgtBEAMWALL:RawPartManagerWndV Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
                        
            <GridSplitter Grid.Row="1"
                          Grid.ColumnSpan="2"
                          Style="{StaticResource Height_GridSplitter}"/>

            <EgtBEAMWALL:PartInRawPartManagerWndV Grid.Row="2" 
                                                  Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>

         </Grid>
      </Grid>
   </Grid>

</EgtFloating:EgtFloatingManager>
