DockSiteLayoutSerializer calling LoadFromString causes Unloaded event to fire

Docking/MDI for WPF Forum

Posted 7 years ago by Joel Nelson
Version: 17.1.0651
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

Hello,

I am using an instance of DockSiteLayoutSerializer to call LoadFromString, using a dockSite as a parameter:

DefaultDockSiteLayoutSerializer.Instance.LoadFromString(_settings.Layout, _dockSite);

For some reason, somewhere in LoadFromString is firing an Unloaded event on ContentControls within the DockSite.  I don't want it to fire Unloaded because other objects are listening for that Unloaded event and reacting like it was unloaded when I am just trying to load the DockSite settings layout upon opening the view.  Oddly enough, the Unloaded event is only fired in LoadFromString when I run the program from the executable, it doesn't happen when I run from Visual Studio.  Do you know what is going on here?

Thanks,

Joel

Comments (1)

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

Hi Joel,

I'm not sure since all we are doing is readjusting the control hierarchy in layout loads.  We've found in numerous cases (not even related to Docking/MDI usage) that the Unloaded event isn't always reliably fired by native WPF.  I might suggest that you watch something more like our DockSite.WindowsClosed event since that will fire correctly as a docking window is removed from the layout.


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.