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
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.
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.
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.
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.
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.