Serialization and Floating Windows

Docking/MDI for WPF Forum

Posted 12 years ago by Doug Beck
Avatar
I'm attempting to do serialization of DocumentWindows. If users don't float any windows, it works fine. Here's what I do.

1. Get all of the windows created into a dock site.
2. Load the layout string using serializer.LoadFromString(strLayout, mMainWindow.dockSite);

However, if the user happened to float any of the windows, I get a crash that says;

"Element already has a logical parent. It must be detached from the old parent before it is attached to a new one."

I can avoid this crash if I figure out which window needs to be floated and doing the float before I do the load. However, that's not particularly easy. Is this the only way to do it?

[Modified at 01/23/2012 11:55 AM]

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Doug,

I'm not entirely sure what your step #1 is, as you should just need to call LoadFromString. But if you can please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

Posted 12 years ago by Doug Beck
Avatar
I sent a project separately, but here's what you have to do. Create a DockSite with two windows. Drag one window out of the application such that it is floating. Save the layout string. Drag the window back into the application and load the layout string. Crash.
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Doug,

I was unable to reproduce the issue you are describing using our latest version. The version your project is using (2010.2 build 0531) is over a year old and we have had several releases, with numerous fixes, in that time.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.