Problem re-docking rafted document window

Docking/MDI for WPF Forum

Posted 14 years ago by RS
Version: 9.2.0512
Avatar
We're trying to implement the great new VS 2010 style rafting document windows feature you recently introduced and we are hitting some odd behavior when re-docking a rafted window.

What it looks like (perhaps) is that the datacontext is being reset when the window is docked, as all our populated data in the window is cleared once the window is docked back as a tabbed MDI document window.

I'm hoping you can give me a bit of insight into whether there is any "magic" going on when the window is docked from a rafted state that our code might be falling foul of.

RS

Comments (5)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

If you can please put together a small sample project that reproduces the issue and email it over to our support address, then we can take a look.


Actipro Software Support

Posted 14 years ago by RS
Avatar
I couldn't reproduce the problem in your sample browser, that's why I'm asking for some background info on whether you are manipulating the UIElement at all (in particular the datacontext) when docking again after rafting - before spending a great deal of time trying things with our code to identify the issue.

RS

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
The only thing we do is bind the DataContext of the RaftingWindow (which holds the floating windows) to the DockSite.DataContext. This allows the windows to inheirt the same DataContext from the DockSite when floating or docked.

If you are setting the DataContext on a ToolWindowContainer, TabbedMdiContainer, or SplitContainer, then that could be your problem. Those types are created and destroyed dynamically by the DockSite as windows are docked/undocked.


Actipro Software Support

Posted 14 years ago by RS
Avatar
Thanks for the reply - that's almost certainly the problem then. We're using the tag property on the documentwindow itself, as well as setting the datacontext. Is there a way for us to manage the transition in code (i.e. some event that would allow us to migrate the properties to the newly created container window)? Or even some events as the windows get destroyed / created for floating/docking - or is that stuff internal?

RS

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you are just setting the DocumentWindow.DataContext/Tag then it shouldn't be a problem, as the DocumentWindow is simply moved around. If you are setting the DataContext/Tag on one of the container types listed above, then it would be a problem.

The DockSite.WindowDragged event is fired after the window is dragged from one location to another. But that doesn't get fired if you programmatically (which includes commands and end-user context menus).


Actipro Software Support

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.