ResizingPanel Problems with 2 DocumentPane Vertically Oriented

Feb 26, 2010 at 8:49 PM
Edited Feb 26, 2010 at 9:16 PM

Hi there.

Ok i will try to expain the problems i face:

1. the setup of the UI is illustrated in the following snippet:

   <ad:DockingManager x:Name="dockManager">
                            <ad:ResizingPanel Orientation="Horizontal" Name="ResizingPanelHorizontal">
                                <ad:DockablePane x:Name="DockablePaneLeft" ad:ResizingPanel.ResizeWidth="250" ad:ResizingPanel.ResizeHeight="130" SizeChanged="DockablePaneLeft_SizeChanged"></ad:DockablePane>
                                <ad:ResizingPanel Orientation="Vertical" Name="ResizingPanelVertical">
                                    <ad:DocumentPane x:Name="CADHost" ad:ResizingPanel.ResizeWidth="600" ad:ResizingPanel.ResizeHeight="400"></ad:DocumentPane>
                                    <ad:DockablePane x:Name="DockablePaneRight" ad:ResizingPanel.ResizeWidth="130" ad:ResizingPanel.ResizeHeight="130"></ad:DockablePane>
                                    <ad:DocumentPane x:Name="DocumentPaneBottom" ad:ResizingPanel.ResizeWidth="150" ad:ResizingPanel.ResizeHeight="150"></ad:DocumentPane>
                                </ad:ResizingPanel>
                            </ad:ResizingPanel>
                        </ad:DockingManager>

2. I have added 2 DockableContents in "CADHost" DocumentPane, and another 2 in "DocumentPaneBottom" DocumentPane.

3. I use different buttons (Click events) to invoke the DocumentContents in case they were Closed.

E.g

        private void tru3DWindowBtn_Click(object sender, RoutedEventArgs e)
        {
            InvokeTtru3DWindow();
            return;
        }

        private void InvokeTtru3DWindow()
        {

            if (ttru3DWindow.Parent != null)
            {
                String tempParentType = (ttru3DWindow.Parent.GetType()).ToString();

                // Closed as Floating Window
                if ((tempParentType != "AvalonDock.DocumentPane") && !CADHost.Items.Contains(ttru3DWindow))
                {
                    ((FloatingDockablePane)ttru3DWindow.Parent).Items.Remove(ttru3DWindow);
                    dockManager.Show(ttru3DWindow);
                    ttru3DWindow.SetAsActive();
                    return;
                }

                if ((tempParentType == "AvalonDock.DocumentPane") && !CADHost.Items.Contains(ttru3DWindow))
                {
                    ((AvalonDock.DocumentPane)ttru3DWindow.Parent).Items.Remove(ttru3DWindow);
                    CADHost.Items.Add(ttru3DWindow);
                    ttru3DWindow.SetAsActive();
                    return;
                }
            }
            //Existing as DocumentContent but not Focused
            if (!ttru3DWindow.IsActiveContent && CADHost.Items.Contains(ttru3DWindow))
            {

                ttru3DWindow.SetAsActive();
                return;
            }
            //Closed as DocumentContent Content
            if (!CADHost.Items.Contains(ttru3DWindow))
            {
                CADHost.Items.Add(ttru3DWindow);
                ttru3DWindow.SetAsActive();
            }
        }

This is what happens:

1st ISSUE (red color in snippet above):

a.  In case i close BOTH DocumentContents in any DocumentPane, the other ofcource resizes fully. BUT i cannot recall anyone of the closed DocumentContents. (for some reason, it seems that their parent is NOT null!

b. If i close ALL four (4) DocumentContents, the DocumentContents that belonged to the LASTLY closed DocumentPane, behaive normally, while the DocumentContents closed FIRST cannot be invoked (The parent of the LAST DocumentContents is null, while the Parent of the first DocumentContents is not null)

2nd ISSUE (blue color in snippet above):

if a DocumentContent is set to floating state and closed using the blue colored code above, a "ghost" of the floating window remains on the screen. This dissapears only if i click anywhere on it.

Anyone experienced these before? Any Ideas how to solve them?

Thanks

Louis