<EgtFloating:EgtFloatingManager x:Class="ProjectV"
                                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:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
                                xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer">
   <EgtFloating:EgtFloatingTray x:Name="PROJECTTOPTRAY" DockPanel.Dock="Top">
      <EgtBEAMWALL:ProjManagerV DataContext="{StaticResource ProjManagerVM}"
                                Visibility="{Binding DataContext.ProjManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
      <EgtBEAMWALL:ProdManagerV DataContext="{StaticResource ProdManagerVM}"
                                Visibility="{Binding DataContext.ProdManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
      <EgtBEAMWALL:OptimizePanelV DataContext="{StaticResource OptimizePanelVM}"
                                  Visibility="{Binding DataContext.OptimizePanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
      <EgtBEAMWALL:StatisticsTimePanelV DataContext="{StaticResource StatisticsTimePanelVM}"
                                        Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>

   </EgtFloating:EgtFloatingTray>

   <!--<EgtBEAMWALL:FreeContourInputV DockPanel.Dock="Right"
                                  DataContext="{StaticResource FreeContourInputVM}"
                                  Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->

   <Grid>
      <Grid.ColumnDefinitions>
         <ColumnDefinition Width="{Binding GridDims[0].GridLen, Mode=TwoWay}"/>
         <ColumnDefinition Width="Auto"/>
         <ColumnDefinition Width="{Binding GridDims[1].GridLen, Mode=TwoWay}"/>
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="{Binding GridDims[2].GridLen, Mode=TwoWay}"/>
         <RowDefinition Height="Auto"/>
         <RowDefinition Height="{Binding GridDims[3].GridLen, Mode=TwoWay}"/>
      </Grid.RowDefinitions>
      <EgtBEAMWALL:LeftPanelV Grid.Column="0" 
                              Grid.RowSpan="4" 
                              DataContext="{StaticResource LeftPanelVM}"
                              Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                              Visibility="{Binding DataContext.LeftPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
      <GridSplitter Grid.Column="1" 
                    Grid.RowSpan="4"
                    Width="3"
                    HorizontalAlignment="Center" 
                    VerticalAlignment="Stretch"/>
      <EgtFloating:EgtFloatingTray x:Name="SCENETOPTRAY" 
                                   Grid.Column="2" 
                                   Grid.Row="0">
         <WrapPanel Orientation="Horizontal" Width="{Binding ActualWidth, ElementName=TOPTRAY}">
            <EgtBEAMWALL:ShowPanelV DataContext="{StaticResource ShowPanelVM}"/>
            <EgtBEAMWALL:ShowBeamPanelV DataContext="{StaticResource ShowBeamPanelVM}"
                                        Visibility="{Binding DataContext.ShowBeamPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
            <EgtBEAMWALL:ViewPanelV DataContext="{StaticResource ViewPanelVM}"/>
            <EgtBEAMWALL:InstrumentPanelV DataContext="{StaticResource InstrumentPanelVM}"/>
            <EgtBEAMWALL:CalcPanelV DataContext="{StaticResource CALCPanelVM}"/>
            <EgtBEAMWALL:SpecialPanelV DataContext="{StaticResource SpecialPanelVM}"
                                       Visibility="{Binding DataContext.SpecialPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
            <EgtBEAMWALL:FreeContourManagerV DataContext="{StaticResource FreeContourManagerVM}"
                                             Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
         </WrapPanel>
      </EgtFloating:EgtFloatingTray>
      <!--<Grid Grid.Column="2" Grid.Row="1">
         <Grid.RowDefinitions>
            <RowDefinition MinHeight="5"/>
            <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>-->
      <EgtBEAMWALL:SceneHostV Grid.Column="2" Grid.Row="1"/>
      <!--<EgtBEAMWALL:PartManagerV Grid.Row="1"
                                   DataContext="{StaticResource PartManagerVM}"
                                   Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                   Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>-->

      <!--</Grid>-->
      <GridSplitter Grid.Column="2" 
                    Grid.Row="2"
                    Height="3" 
                    HorizontalAlignment="Stretch"/>
      <Grid Grid.Column="2"
            Grid.Row="3">
         <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition MinHeight="5"/>
         </Grid.RowDefinitions>
         <EgtBEAMWALL:FreeContourInputV Grid.Row="0"
                                  DataContext="{StaticResource FreeContourInputVM}"
                                  Visibility="{Binding DataContext.FreeContourManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
         <EgtBEAMWALL:PartManagerV Grid.Row="0"
                                   DataContext="{StaticResource PartManagerVM}"
                                   Tag="{Binding DataContext.BTLStructureVM.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                   Visibility="{Binding DataContext.PartManager_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"/>
         <Grid Grid.Column="2" Grid.Row="1">
            <EgtBEAMWALL:TopPanelV 
                                    DataContext="{StaticResource TopPanelVM}"
                                    Tag="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                    Visibility="{Binding DataContext.TopPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                    Height="Auto"/>
            <EgtBEAMWALL:BottomPanelV
                                       DataContext="{StaticResource BottomPanelVM}"
                                       Tag="{Binding DataContext.BTLStructureVM, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                       Visibility="{Binding DataContext.BottomPanel_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:ProjectV}}}"
                                       Height="Auto"/>
         </Grid>

      </Grid>
   </Grid>

</EgtFloating:EgtFloatingManager>
