Restrict Docking Locations

Docking/MDI for WPF Forum

Posted 7 years ago by Miles Merckel
Version: 17.1.0651


I’ve started to use the newer docking library, in doing so I’ve changed my DocumentWindows to ToolWoolWindows to get the same result.

Previously the docking locations could be restricted by setting CanDocumentsDockLeft="False" CanDocumentsDockBottom="False" etc. I’ve gone through the documentation checked the "Converting to 2016.1" and run through the sample browser but there appears to be no way of restricting where the toolwindow can be docked. Is this possible in the new version?

Many Thanks


Comments (3)

Posted 7 years ago by Miles Merckel

Ok I found the AllowedDockGuideKinds property which can be set inside the WindowsDragOver event handler.

I can see the inner and outer guides when set accordingly but when I set it to center to allow docking as a document there is no guide displayed. I have ensured the DockSite CanToolWindowsAttach="True" and the ToolWindow I’m trying to dock as a document has it’s CanAttach="True".

If I right click the floating tool window header area and select "Dock as Document" from the menu it does exactly what I want it to do. Is it possible to dock the tool window as a document by dragging onto a center dock guide?

Answer - Posted 7 years ago by Miles Merckel

Experimenting a bit further I managed to resolve it. ToolWindow CanDragToLinkedDockSites property was explcitly set to False, setting this to true or resetting allowed the ToolWindow to be dragged onto a center dock guide.

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

Hi Miles,

Yes, we didn't implement those properties in the newer 2016.1 version because while they worked for the most simplistic scenarios, we wanted to make a more robust mechanism, and one that would handle the new floating MDI support.

As you saw, in the latest version, check out the "Docking/MDI / Docking Window Features / Docking Window Capabilities" topic and the "Limiting the Allowed Dock Guides While Dragging" section in that.  It describes the new callback event that fires whenever dock guides are about to show, and allows you to programmatically limit there based on the scenario.

I'm also adding a note in the conversion documentation to refer to that section as a replacement for the CanDock properties.

On your other question, the CanDragToLinkedDockSites shouldn't have any effect if you are only using a single DockSite.  But if you are using multiple linked DockSites, then yes, that would be needed.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.