After docking a ToolWindow, the bindings are not working.

Editors for WPF Forum

Posted 4 years ago by Daniel Constantin - ModuleWorks GmbH
Version: 19.1.0684


I have an application which uses a lot of tool windows. Inside the main window, I bind the DataContext of each tool window to some object from the parent DataContext (view model) of the main window.

If I drag a tool window and dock it in the same place it was I have no problems but if I dock it in a new place (probably creating automatically in the background other split and tool window containers) the bindings seems to get lost.

It’s like the tree chain of parent – child elements is broken somewhere. (DataContext become null for the docked tool window).

Kind regards,


Comments (2)

Posted 4 years ago by Daniel Constantin - ModuleWorks GmbH

I have a workaround for now.

I do the bindings using the ElementName option directly connecting to the main window

<toolWindows:Test x:Uid="TestToolWindow"
                                DataContext="{Binding DataContext.Test, ElementName=mainWindow}">

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

Hi Daniel,

Please see the "Docking/MDI / Troubleshooting" topic in the documentation that comes with the product.  That has a section that talks about docking window DataContexts.  To sum up, as layout changes occur, UI controls are moved around and the visual tree is changed.  DataContext inheritance won't work properly with that going on.  That being said, there's an easy workaround in that topic that you can implement, which is similar to what you ended up doing.

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.