Bug: Overlapping DockablePanes

Apr 7, 2009 at 3:38 PM
Hi,

I'm working with version 1.2 and I encounter an overlapping problem between two DockablePanes that belong to two different DockingManager (one including the other).
Here is the structure of my GUI:

        <ad:DockingManager x:Name="dockingManager"
                           Grid.Row="2">
            <ad:ResizingPanel x:Name="resizingPanel"
                              Orientation="Vertical">
                <ad:DocumentPane x:Name="documentsHost">

                            <ad:DockingManager Name="dockingManager2">
            <ad:ResizingPanel Name="resizingPanel2"
                              Orientation="Horizontal">

                <!-- My first DockablePane which encounters the overlap problem -->
                <ad:DockablePane Name="treeDockablePane"
                                 ad:ResizingPanel.ResizeWidth="250">
                    <ad:DockableContent Name="treeDockableContent"
                                        Title="Equipment">
                        <TreeView DockPanel.Dock="Left"
                                  VerticalAlignment="Stretch"
                                  ItemsSource="{Binding Source={StaticResource itemsSourceForTreeView}}" />
                    </ad:DockableContent>
                </ad:DockablePane>

                <!-- Detail area -->
                <StackPanel x:Name="detailPanel" 
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch">
                    <Label Content="Test..." />
                </StackPanel>
            </ad:ResizingPanel>
        </ad:DockingManager>
                </ad:DocumentPane>

                <!-- My second DockablePane which encounters the overlap problem -->
                <ad:DockablePane x:Name="logPane"
                                 ad:ResizingPanel.ResizeHeight="200">
                    <ad:DockableContent x:Name="logDockableContent"
                                        Title="Logs">
                        ...
                    </ad:DockableContent>
                </ad:DockablePane>
            </ad:ResizingPanel>
        </ad:DockingManager>

When I set these two DockablePanes in AutoHide mode, and then try to display both of them, they overlap each other during the time they are both displayed.
Then, when the first one hides itself, the second one has a part of itself that isn't redrawn (being rendered as a grey surface).

Is this possible to force the DockablePane belonging to the main DockingManager (the one including the other) to be displayed on top of the other DockablePane ?
Is there a way to refresh all the DockablePanes when one of them hides itself ? (in order not to have the grey surface)

Thanks.

Apr 8, 2009 at 10:38 AM
Hi,
you xaml I suppose should not work at all. DockingManager is intended to be used as containter for one of the following class DockablePane, DocumentPane or ResizingPanel. You should not nest two or more DockingManager.
Why do you need more than one DockingManager objects?

Ado
Apr 8, 2009 at 12:18 PM
Edited Apr 8, 2009 at 12:18 PM
My XAML works perfectly, but I just saw that I've made a mistake when writing it in my previous post (I forgot a DocumentContent).
Here is the working XAML:

<ad:DockingManager x:Name="dockingManager" Grid.Row="2">
   <ad:ResizingPanel x:Name="resizingPanel" Orientation="Vertical">

      <ad:DocumentPane x:Name="documentsHost">
         <ad:DocumentContent>
            <ad:DockingManager Name="dockingManager2">
               <ad:ResizingPanel Name="resizingPanel2" Orientation="Horizontal">
                  <!-- My first DockablePane which encounters the overlap problem -->
                  <ad:DockablePane Name="treeDockablePane" ad:ResizingPanel.ResizeWidth="250">
                     <ad:DockableContent Name="treeDockableContent" Title="Equipment">
                        <TreeView DockPanel.Dock="Left" VerticalAlignment="Stretch" ItemsSource="{Binding Source={StaticResource itemsSourceForTreeView}}" />
                     </ad:DockableContent>
                  </ad:DockablePane>

                  <!-- Detail area -->
                  <StackPanel x:Name="detailPanel"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                     <Label Content="Test..." />
                  </StackPanel>
               </ad:ResizingPanel>
            </ad:DockingManager>
         </ad:DocumentContent>
      </ad:DocumentPane>

      <!-- My second DockablePane which encounters the overlap problem -->
      <ad:DockablePane x:Name="logPane" ad:ResizingPanel.ResizeHeight="200">
         <ad:DockableContent x:Name="logDockableContent" Title="Logs">
            ...
         </ad:DockableContent>
      </ad:DockablePane>
   </ad:ResizingPanel>
</ad:DockingManager>



In fact, I wanted to use two DockingManagers in order to constraint moves.
Suppose I define:
   - a DockablePane (A) and a DocumentPane (B) in my dockingManager1
   - a DockablePane (C) and a DocumentPane (D) in my dockingManager2

My components A and B can only be docked in my dockingManager1 and so cannot be docked in my dockingManager2.
The opposite thing goes for components C and D.

What I wanted to achieve was to have a log panel (which is my component A) and a working area (B).
My working area (which is a DocumentPane) will be filled with DocumentContents containing UserControls.
These UserControls can be composed of DockablePanes, DocumentPanes and usual panels.

The interest of having two DockingManagers is that I can forbid my log panel to be docked in my working area.
Apr 8, 2009 at 1:19 PM
ok, now works, these are a few hints:
- if you don't want a dockablecontent to be constrained in a layout position the preferred way is to set its DockableStyle property; setting it to DockableToBorders you allow user to redock the content only to borders of the relative DockingManager and not in the working area (DocumentPane).
- in you scenario flyout windows overlap because when a new flyout window is shown the existing flyout window is first hidden. Of course this works only for a single dockingmanager. Anyway you can look a this method: DockingManager.ShowFlyoutWindow();

Ado
Apr 9, 2009 at 8:44 AM
<quote>
- if you don't want a dockablecontent to be constrained in a layout position the preferred way is to set its DockableStyle property; setting it to DockableToBorders you allow user to redock the content only to borders of the relative DockingManager and not in the working area (DocumentPane).
</quote>
That would force my log panel to dock only on borders and not in my working area.
But that will not force my DockablePane C (which is part of my working area) to be docked in my working area and nowhere else.

In fact DockablePane C is a part of a DocumentContent added to the DocumentPane representing the working area, and I don't want C to be docked outside its parent DocumentContent.
Is there a way to achieve that ?