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>
lemainan said:Now float document1. Document 2 is still docked.
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.
I understand that it is consistent with VS2008 - but I still claim the behavior does not feel consistent to a user. If I also set AllowDocking=False for the document panes so they cannot be docked left/top/bottom/right (as is the desired behavior in our application), the behavior is even less understandable from a user perspective.
In this case, you will only see the center indicator (as expected). If the pane was dragged from a docked state, I can drop it on any of the five positions, and it is positioned in the document host. If the pane was dragged from a floating state, only the center position allows drop. It's hard to justify this behavior to our users.
I think that if I have a floating pane with AllowDocking=False, AllowInDocumentHost=True and AllowDockingFloating=True, the drop behavior should be to place it in the document host instead of a new split pane (or as is the current case, not allow the drop)
I can understand your perspective but it would also be inconsistent to conditionally treat the center container based on the state of the pane(s) being dragged especially since that floating dockable pane could contain some panes that allow docking and others that do not.
I'm sorry but no it's not currently possible to override this behavior.
Seems I'll have to hope for a VS2010 style docking behavior in the (near?) future, then. Feel free to use my sample in the initial question, with AllowDocking set to false for the two documents as a test case.
Or is it possible to somehow override the default behavior?