Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
Inconsistent docking behavior for document panes
posted

The layout below produces inconsistent results depending on whether documents are tabbed or floating. Select Document1, drag it to position it to the right of document2. Now you have two documents side by side. Fine!

Now float document1. Document 2 is still docked.

Now try to dock document1 to the right of document2 again. This is not possible. You have to first place document1 on top of document2.

If you remove AllowDocking=False, it's possible to dock Document1, but it is not docked in the documenthost in this case (it looks different from document2)

This behavior is inconsistent from a usage perspective. I should be able to dock panes in the location they came from, shouldn't I?

        <docking:XamDockManager>
 
            <docking:XamDockManager.Panes>
                <docking:SplitPane SplitterOrientation="Horizontal" Width="auto">
                    <docking:TabGroupPane>
                        <docking:ContentPane AllowInDocumentHost="False">
                            <Label Content="Left"/>
                        </docking:ContentPane>
                    </docking:TabGroupPane>
                </docking:SplitPane>
                <docking:SplitPane SplitterOrientation="Horizontal" docking:XamDockManager.InitialLocation="DockedRight" Width="auto">
                    <docking:TabGroupPane >
                        <docking:ContentPane AllowInDocumentHost="False">
                            <Label Content="Right"/>
                        </docking:ContentPane>      
                    </docking:TabGroupPane>
                </docking:SplitPane>
                <docking:SplitPane docking:XamDockManager.InitialLocation="DockedTop" Height="auto">
                    <docking:TabGroupPane>
                        <docking:ContentPane AllowInDocumentHost="False">
                            <Label Content="Top"/>
                        </docking:ContentPane>
                    </docking:TabGroupPane>
                </docking:SplitPane>
                <docking:SplitPane docking:XamDockManager.InitialLocation="DockedBottom" Height="auto">
                    <docking:TabGroupPane >
                        <docking:ContentPane AllowInDocumentHost="False">
                            <Label Content="Bottom"/>
                        </docking:ContentPane>
                    </docking:TabGroupPane>
                </docking:SplitPane>
            </docking:XamDockManager.Panes>
 
            <docking:DocumentContentHost >
                <docking:SplitPane>
                    <docking:TabGroupPane>
                        <docking:ContentPane Header="Document1" AllowDocking="False" AllowDockingFloating="True" CloseAction="RemovePane">
                            <Label Content="Document1"/>
                        </docking:ContentPane>
                        <docking:ContentPane Header="Document2" AllowDocking="False" AllowDockingFloating="True" CloseAction="RemovePane">
                            <Label Content="Document2"/>
                        </docking:ContentPane>
                    </docking:TabGroupPane>
                </docking:SplitPane>
            </docking:DocumentContentHost>
        </docking:XamDockManager>
Parents
No Data
Reply
  • 54937
    Offline posted

    lemainan said:
    Now float document1. Document 2 is still docked.

     Technically Document 2 has a PaneLocation of Document and exists within the DocumentContentHost.

    lemainan said:
     Now try to dock document1 to the right of document2 again. This is not possible. You have to first place document1 on top of document2.

    The behavior of the xamDockManager is consistent with VS 2008 which is the version of VS available when xamDockManager was designed and written. When one drags over one of the global indicators (the up, down, left or right arrow displayed along the outer edge of the xamDockManager), a new separate SplitPane is created along that outer edge to host the content. When one drags a dockable pane (in this case the floating pane is floating dockable) over a dockable pane (i.e. floating dockable, docked left, docked right, docked top or docked bottom), the center indicator is displayed with options of adding the pane to that pane or positioning it relative to that pane. When over the center content (the DocumentContentHost in this case), the center portion of that dock indicator is used to add the pane to that area (in this case add it to the tabgroup in the DocumentContentHost containing the ActiveDocument) and the left/right/top/bottom portion are used to create a new docked (i.e. PaneLocation of DockedLeft, DockedRight, DockedTop or DockedBottom) split pane along the inner edge of the xamDockManager.  In VS 2010, MS added an extra set of docking indicators when over the panes in the tabbed document area. You may want to submit a feature request for adding this functionality to the xamDockManager.

Children