DocumentContent docking problem

Sep 6, 2009 at 1:44 PM

Hi (again)... 

here is the problem:

I have 2 DocumentContents in a DocumentPane appearing as tabs.

When i try to dock one of the two DocumentContents, in the same DocumentPane, but Docked in the bottom, the DocumentContent that is supposed to be docked, hides somewhere behind the other DocumentContent.

I hope it makes sense what i just wrote!!

Thanks in advance

Louis

 

 

Sep 6, 2009 at 4:26 PM

Hi Louis,
Hmmm, ...

I tried it with the demo-project and I think, it works.
Please try it with that, too and tell me the result.

When I dock a DocumentContent to the bottom of a DocumentPane, there will be open another DocumentPane where it will displayed.
Hope, that's correct, Ado.

I tried it with my project and it works, too.

So try it please with the demo-project.

Juergen

 

Sep 7, 2009 at 7:40 AM

Yes, a new DocumentPane is created along with a new ResizingPanel with vertical orientation. The second DocumentPane will host the DocumentContent on the bottom.

I've just tried and it seems to work, could you please post your xaml, I'll try with that, thanks,

 

Ado

Sep 7, 2009 at 2:58 PM

Hi Juergen, Ado,

 

i found the problem . i changed the ad:ResizingPanel.ResizeHeight="600" to ad:ResizingPanel.ResizeHeight="300" and it appears as it should.

just for the info i am sending you the code snippet concerning the Docking of windows (since the Xaml file is huge):

<!--2D AND 3D TABS-->
                    <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5"  Name="Main2D3DDesigner" ShowGridLines="False">
                       
                        <ad:DockingManager x:Name="dockManager">
                            <ad:ResizingPanel Orientation="Vertical" Name="ResizingPanelVertical">
                                <ad:ResizingPanel Orientation="Horizontal" Name="ResizingPanelHorizontal" >
                                    <ad:DockablePane x:Name="DockablePaneLeft" ad:ResizingPanel.ResizeWidth="150" ad:ResizingPanel.ResizeHeight="150"></ad:DockablePane>
                                    <ad:DocumentPane x:Name="CADHost" ad:ResizingPanel.ResizeWidth="600" ad:ResizingPanel.ResizeHeight="300"></ad:DocumentPane>
                                    <ad:DockablePane x:Name="DockablePaneRight" ad:ResizingPanel.ResizeWidth="150" ad:ResizingPanel.ResizeHeight="150"></ad:DockablePane>
                                </ad:ResizingPanel>
                                <ad:DocumentPane Name="DocumentPaneBottom" ad:ResizingPanel.ResizeWidth="140" ad:ResizingPanel.ResizeHeight="140">
                                </ad:DocumentPane>
                            </ad:ResizingPanel>
                        </ad:DockingManager>
                    </Grid>

The code behind :

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US", false);

            CADHost.Items.Add(main3D2DWindow);
            CADHost.Items.Add(ttru3DWindow);

            DocumentPaneBottom.Items.Add(helperLogsWindow);
            DocumentPaneBottom.Items.Add(dataGridViewWindow);
           
            //DocumentPaneBottom

            DockablePaneLeft.Items.Add(scenarioToolBar);
            DockablePaneLeft.Items.Add(truEnvironmentExplorerWindow);

            tru3DObject.ResetAll();

        }

The Xaml for main3D2DWindow:

<ad:DocumentContent x:Class="_3DtruEMGUI.Main3D2DWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:d3d="clr-namespace:Direct3DComponent;assembly=Direct3DComponent"                   
    xmlns:pgc="clr-namespace:PropertyGridContainer;assembly=PropertyGridContainer"              
    xmlns:ad="clr-namespace:AvalonDock;assembly=AvalonDock"
    Title=" Main 3D2D CAD " Height="600" Width="600"
    Loaded="DockableContent_Loaded"
    KeyDown="DockableContent_KeyDown">
   
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="auto" MinHeight="30"></RowDefinition>
        </Grid.RowDefinitions>
     
                <WindowsFormsHost Grid.Column="0" Grid.Row="0">
                    <d3d:Direct3DComponentContainer x:Name="D3DTruContainer3D2D"></d3d:Direct3DComponentContainer>
                </WindowsFormsHost>
            <!--</TabItem>
        </TabControl>-->
        <Border Grid.Column="0" Grid.Row="1" BorderThickness="1" BorderBrush="Gray" Margin="0,2,0,2">
            <Grid Grid.Column="0" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition Width="40"></ColumnDefinition>
            </Grid.ColumnDefinitions>
           
            <Grid Grid.Column="0">
                    <StackPanel Orientation="Horizontal">               
                        <Label>Position:</Label>
                        <Label>X:</Label>
                        <TextBox Name="main3D2DWindowCurrentPositionX"
                                 Width="60" Margin="3" Padding="2"
                                 BorderThickness="1" BorderBrush="LightGray"
                                 Text="{Binding Path=Double, StringFormat=F2}"></TextBox>
                        <Label>Y:</Label>
                        <TextBox Name="main3D2DWindowCurrentPositionY"
                                 Width="60" Margin="3" Padding="2"
                                 BorderThickness="1" BorderBrush="LightGray"></TextBox>
                        <Label>Z:</Label>
                        <TextBox Name="main3D2DWindowCurrentPositionZ"
                                 Width="60" Margin="3" Padding="2"
                                 BorderThickness="1" BorderBrush="LightGray"></TextBox>
                    </StackPanel>
            </Grid>
               
            <DockPanel Grid.Column="1" VerticalAlignment="Top">
                <Label>Element:</Label>
                <StackPanel Name="ElementImagePanel" VerticalAlignment="Center"></StackPanel>
                <!--<Image Name="ElImage"></Image>-->
            </DockPanel>

            <DockPanel Grid.Column="2" VerticalAlignment="Top">
                <Label>Material:</Label>
                <StackPanel Name="MatImagePanel" VerticalAlignment="Center"></StackPanel>
            </DockPanel>
           
            <Menu Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,1"  BorderThickness="1" BorderBrush="Gray">
                <MenuItem Header="Grid" FontSize="12" FontWeight="Bold" Margin="3" Padding="2"
                          HorizontalAlignment="Center" VerticalAlignment="Center">
                    <MenuItem Header="Color"
                              Name="main3D2DgridColorMenuItem"
                              FontWeight="Normal"
                              Click="main3D2DgridColorMenuItem_Click"></MenuItem>
                    <Separator></Separator>
                    <MenuItem Header="Visible"
                              Name="main3D2DgridVisibilityMenuItem"
                              FontWeight="Normal" IsCheckable="True" IsChecked="True"
                              Click="main3D2DgridVisibilityMenuItem_Click"></MenuItem>
                    <Separator></Separator>
                    <MenuItem Header="Plane" FontWeight="Normal">
                        <MenuItem Header="X-Y" Name="main3D2DgridXYMenuItem" Click="main3D2DgridXYMenuItem_Click"></MenuItem>
                        <MenuItem Header="X-Z" Name="main3D2DgridXZMenuItem" Click="main3D2DgridXZMenuItem_Click"></MenuItem>
                        <MenuItem Header="Y-Z" Name="main3D2DgridYZMenuItem" Click="main3D2DgridYZMenuItem_Click"></MenuItem>
                    </MenuItem>
                        <Separator></Separator>
                        <MenuItem Header="Camera" FontWeight="Normal">
                            <MenuItem Header="Orthographic" Name="main3D2DCameraOrthoMenuItem" Click="main3D2DCameraOrthoMenuItem_Click"></MenuItem>
                            <MenuItem Header="Perspective" Name="main3D2DCameraPerspectiveMenuItem" Click="main3D2DCameraPerspectiveMenuItem_Click"></MenuItem>
                        </MenuItem>
                </MenuItem>
            </Menu>
        </Grid>
        </Border>
    </Grid>
</ad:DocumentContent>

Similar code is for the ttru3DWindow.

I checked several demos and in one case the problem appeared but not i the other cases. i believe that, when the documentation of the library is ready, some tips should be included

Thanks again

Louis