Programmatically Wrap Floated DocumentWindow in new Window (à la Chrome)

Docking/MDI for WPF Forum

Posted 6 years ago by Michael Jelley
Version: 13.2.0592


I'm rather new to this product, so this may already be answered, or trivial to implement. I searched this forum and looked through the docs, and didn't find any related topics.

I want to implement Chrome-like behavior for floating tabs, where a floated DocumentWindow is instantly placed within a new window containing a DockSite (the same type that contained the DocumentWindow initially). I tried deriving from DockSite and overriding CreateRaftingWindow, but from there was unable to determine the correct way to:

a) Create a new owning window (let's call this type MainWindow)
b) Link the docksite in the new window to the docksite in the existing window (so tabs can be dragged freely between MainWindow instances). I do have access to the DockSite instance inside MainWindow, it's named "dockSite".
c) Add the floated DocumentWindow to the docksite of the new MainWindow instance
d) Dock the floated DocumentWindow to that docksite

I'm not even sure if those steps are the best way to achieve the desired effect (again, Chrome-like behavior). Does anyone have ideas for how to do this?


Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Michael,

We don't currently support a full DockSite sort of interface (with MDI, etc.) when a document window is floated.  Right now, a floated document window is standalone and can't be docked with other document windows.  It looks like you are trying to work around the current limitations in that area to build in functionality where you manually create a new DockSite, link them together, and then show the document window there.

CreateRaftingWindow just makes a generic RaftingWindow container.  It's also used for tool windows so it might not be a good place to hook in.

It seems like there are two ways a document window could float.  One is if the user drags a tab, which you could handle the WindowDragged event to know when that happens and then iterate the DockSite.DocumentWindows collection to see if any are in a Floating state.  The second case is if the user executes a menu item for floating.  You can intercept WindowContextMenu to alter menu items and put your own in place of the Floating one.

Then do your other steps you mentioned.  That might just work.

Actipro Software Support

Posted 5 years ago by Michael Jelley

Sorry for reviving this old thread, but I have further issues to work out with this.

I have a partially working implementation of this, using the MVVM model of driving DocumentItemsSource on the DockSite as presented in the samples (also using TabbedMDI).

The problem is that, though I can change the list of document items from VM and have DocumentWindows generated for them, docking an existing tab from a second window (through a linked dock site) back to the first window does not update the binding source of the DocumentItemsSource property. In other words, the direction of updates is one way for the document items.

Is there any way in the existing docking library for me to keep perfectly synchronized the DocumentItemsSource and the actual document window items, across linked dock sites? I've tried numerous things but have reached something of a dead end here.

Feel free to ask for an example project or further explanation, I realize this is a complex issue.

Thanks again,Michael

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Michael,

The DocumentsItemsSource is intended to only manage document windows in the same DockSite and not really across linked DockSites.  So unfortunately I think you are trying to do some advanced implementations here that aren't really supported.

All that being said, we have started on prototyping out possible internal redesigns for the future of the Docking/MDI product.  Per a recent blog post, we're currently looking for suggestions on improvements you'd like to see in the product since now is the time to get them in.  Adding the ability to support tear off MDI areas (when documents are floated) is something on our list of goals to achieve.  If there's anything else you'd like to see, feel free to contact us here or at our support address and we can discuss.

Actipro Software Support

The latest build of this product (v2019.1 build 0684) was released 12 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.