Programmatically Attach ToolWindow

Docking/MDI for WPF Forum

Posted 7 years ago by Miles Merckel
Version: 17.1.0651
Avatar

Hi

I eventually worked out how to restrict a ToolWindow to attach only onto a center dock guide when dragging.

Now I’m trying to programmatically attach a ToolWindow. Whenever I call the ToolWindow.Dock() it always docks to the side. I tried the overload specifying the IDockTarget and Side but this only allows a side to be set, setting side to null is not allowed. Have tried various property settings for CanAttach and CanDock on both DockSite and ToolWindow to no avail. Also set "e.Side = null" in WindowsDefaultLocationRequested with no success.

Selecting “Dock as Document” from the floating ToolWindow options menu has the desired effect but I need to be able to do it programmatically.

Many Thanks

Miles

Comments (2)

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

Hi Miles,

There is an Attach method you can use to attach a ToolWindow to another dock target.

By the way, the "Docking/MDI / Docking Window Features / Lifecycle and Docking Management" topic in the documentation that comes with the product has a section named "Programmatically Changing States and Docking" in it that describes all the programmatic methods for manipulating the layout.


Actipro Software Support

Posted 7 years ago by Miles Merckel
Avatar

Hi

Forgot to mention I used the Attach method and it wouldn’t work but have just realised why. I was using the Docksite as the IDockTarget parameter where as it should be the TabbedMdiContainer name passed to the Attach method.

Ok working now.

Many Thanks

The latest build of this product (v24.1.1) 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.