I have been trying to find a way around this for a while now but cannot seem to make the docking indicators work the way I want all the time.
I have this XAML in my window
<Dock:XamDockManager> <Dock:DocumentContentHost> <DockManager:SplitPane> <DockManager:TabGroupPane /> </DockManager:SplitPane> <DockManager:XamDockManager.Panes> <DockManager:SplitPane DockManager:XamDockManager.InitialLocation="DockableFloating" /> </DockManager:XamDockManager.Panes></Dock:XamDockManager>
In my program, I programmatically add ContentPane to the DocumentContentHost's TabGroupPane. When I go to drag that ContentPane out of the tab group, I only get the 4 edge DockingIndicator hints display: I cannot get the center document docking indictor to display.
If I drag the ContentPane out of tab TabGroupPane and let it float and then start to drag the floating window, I get the center indictor as well as the 4 edge indicators.
My main concern is if I only have one ContentPane in the XamDockManager and I want to dock it outside of the tab group, I have to drag it to a floating window first and then I can create a new non-TabGroupPane dock. I'd rather have that option without having to create a floating window first.
(I've included screen shoots of the process I'm talking about)
I'd really appreciate any ideas where I might be falling down or not understanding the mechanics of how and why the docking indicators display the way they do when dragging a ContentPane out of TabGroupPane buried under the DocumentContentHost.
Thanks in advance
Butch Rosecrans said:If I drag the ContentPane out of tab TabGroupPane and let it float and then start to drag the floating window, I get the center indictor as well as the 4 edge indicators.
The 4 global docking indicators are scoped based on the context of the pane you are dragging. So if you are dragging a pane within the DocumentContentHost then those global docking indicators are for creating new outermost root splits within the DocumentContentHost (i.e. a SplitPane within the DocumentContentHost that is sibling to the current split panes within the DocumentContentHost). When you are dragging a dockable pane (i.e. a pane docked to the left,right,top,bottom or in a dockable floating state) then the global indicators are for creating new outermost root SplitPane docked within the xamDockManager (so a SplitPane in the xamDockManager's Panes collection that is outside the existing split panes.
Butch Rosecrans said: In my program, I programmatically add ContentPane to the DocumentContentHost's TabGroupPane. When I go to drag that ContentPane out of the tab group, I only get the 4 edge DockingIndicator hints display: I cannot get the center document docking indictor to display.
The center docking indicator is based upon what you are dragging over and also where you are dragging from. If you are dragging a dockable pane (again one that is docked left,right,top,bottom or dockable floating), and you drag over any other dockable pane and you will get the center indicator so that you can position the panes being dragged to the left/right/top/bottom of the pane you drag over or over the center to add to/create a tab group with the panes being dragged and the you drag over. When you drag a dockable pane over the documentcontenthost, we show the center docking indicator wherever you are over the document content host so you cannot drag into a specific document in a single operation. This was required to mimic VS behavior whereby you can create a new root split pane that is immediately adjacent to the document area.
Dragging a pane within the DocumentContentHost is different. First, VS has no functionality for dragging out of the document area. We not only support that but we also support being able to created nested groups (VS only allows the document groups to be in a single orientation). So when you drag a document contentpane over any other contentpane within the documentcontenthost we show the center indicator because you can reposition the drag pane relative to that pane (above/below/right/left) or over the central portion to add it to that tab group. We also allow you to drag over any existing content pane outside the document area and we will give you the center indicator so you can immediately drag out of the document area relative to another pane. Since we show a center indicator when over another pane in the document area, the center indicator cannot be use to position a pane relative to the documentcontenthost itself.
Perhaps a future version of the control will support the VS 2010 style center indicator which has multiple options (up to 2 left, 2 right, 2 top, and 2 bottom) so that when you drag a document over another pane within the document area you will get a center indicator which not only lets you create nested document groups but also allows you to create docked split pane adjacent to the document content host. You may want to submit a suggestion for adding this.
BTW, the reason you don't see a center indicator when you have 1 pane within the documentcontenthost is because all of the options of the center indicator would be a visual no op when you released. It would be inconsistent to the end user to treat that case specially and show a center indicator that could created docked split but if they had 2 document panes they could only create document splits.
Hello, I'm having the same problem with undocking a documentPane from the DocumentContentHost and only beeing able to re-dock it after letting go of the pane. I can't undock the document and re-dock it in one go.
Did anything change for this behaviour? Is it now possible to enable it somehow or is it still not possible?
So just to be clear you are attempting to mouse down upon a floating pane and drag back into the DocumentContentHost or are you talking about dragging a pane out of the DocumentContentHost and without releasing the mouse wanting dock the pane to an edge just outside the DocumentContentHost? If it's the former is this a situation where the pane itself is always considered to be (or would prefer to be considered) a document? Unfortunately in either case right now this is not possible and likely this would need to be submitted as a feature request but I'm asking to try and get a better understanding of the requirement/scenario. It might be possible to add a property to the PaneDragStarting event args to determine whether the central area should prefer the DocumentContentHost or docking adjacent to the DocumentContentHost.
Almost, I'm talking about the second case, but I don't want to dock the pane outside the DocumentContentHost but inside, the exact same spot where I undocked from. The problem is there are no dock indicators visible on the DocumentContentHost. Only after releasing the mouse and clicking the (now floating) pane again and moving it over the DocumentContentHost do I see the dock indicators.
Sorry but I'm not following. What I described for the second case was dragging a pane that is currently within the DocumentContentHost. If you are dragging a pane that is within the DocumentContentHost then it can be dragged anywhere within the DCH (i.e. you get center indicators over each TabGroupPane within the DCH). I think you must mean that you are dragging a pane that used to be within the DCH but is now floating (in which case the state is floating dockable) or docked to one of the edges of the XDM and you want to drag it to a specific location within the DCH without first dropping it in the middle of the center indicator, releasing and then repositioning it somewhere else within the DCH. That would be the first scenario that I was describing. For a pane that is not currently within the DCH we only show the center indicator over the entire DCH and not show center indicator over each TabGroupPane within the DCH. I already described in the previous responses why it works that way and for that I see 2 possible solutions although there might be others I'm not thinking of. One is to implement VS 2010 style expanded docking indicators where dragging over the DCH would show a center docking indicator with more options. The other would be if we knew that this pane preferred to be a document (whether that be a property on the pane or that be a property on the PaneDragStartingEventArgs) we would when you drag the pane over the center area allow positioning within the DCH (i.e. you would get center indicators for each TabGroupPane within the DCH). The latter would limit one in that they would not be able to drag a pane to be docked outside but immediately adjacent to the DCH; the only options for docking to an edge as part of that drag operation would then be dragging over a docked pane header/tab or using one of the outside edge global docking indicators (the four single arrows on each outside edge of the XDM). If we did anything in an SR it would likely be only the property on the event args because the 1st option would be too much for an SR and the document property on the pane would require more consideration as likely that would/could have other uses/implications on behavior and possibly look. If I'm still not understanding the scenario please let me know where the pane in your situation is when you mouse down upon it, where you are trying to drag it to, etc. One other thing that might be a nice option to have is to preserve the last document location when one drags it over the center indicator. We do that for keeping the last docked/floating panes but not within the DocumentContentHost primarily because VS didn't - it just always put it into tab group containing the active document.
I forgot to mention that I'm dragging the only documentContent in the DocumentContentHost, like the first post of the thread described. In that case there are no indicators over the DCM until I let it go and drag it again.
I was looking at the screenshots Butch Rosecrans posted, they show the case I was referring to.
To sum it up:1. I have a DCM with one DocumentContentPane in it (like starting.jpg by Butch)2. I'm dragging the DCP and the DCM is now empty (so no TabGroupPanes that could offer dock indicators)3. (While still holding the mouse down) I'm draging the DCP over the DCM and see no dock indicators (startdrag-only4indicators.jpg)4. I let go of the DCP5. I drag the DCP over the DCM and see the dock indicators (start2nddrag-center+4indicators.jpg)
I hope described it to your understanding this time.
OK I understand now. The last paragraph of this reply explains the issue. We ignore/suppress the center indicator in that situation because the TabGroupPane wouldn't exist with that pane not being there and therefore one cannot drop it to the right/top/bottom/left of that and dropping on the center would be a no-op so the indicator is not displayed. If one wanted to cancel the operation one could just press the Escape key.