DockSiteLayoutSerializer and newly added toolwindows

Docking/MDI for WPF Forum

Posted 5 years ago by Miguel A.
Version: 18.1.0673
Avatar

Hi,

I have a problem that when DockSiteLayoutSerializer has saved a layout in version 1 and I then add new toolwindows for version 2 of my app, these tool windows aren't shown. I or the customer have to delete the saved layout and then start the app again. Is there a way to say "if toolwindow does not exist in saved layout, then show it" ?

These are my settings

layoutSerializer = new DockSiteLayoutSerializer()
            {
                SerializationBehavior = DockSiteSerializationBehavior.ToolWindowsOnly,
                ToolWindowDeserializationBehavior = DockingWindowDeserializationBehavior.AutoCreate,
            };

[Modified 5 years ago]

Comments (3)

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

Hi Miguel,

There's not a way to do that automatically but if you detect that your restored layout was created in the new version, you could just call the Open() method on the new docking windows that were added after the layout load.  That would get them all showing and the next layout save/load cycle would be for the new version so that logic would be skipped from that point forward.


Actipro Software Support

Posted 5 years ago by Miguel A.
Avatar

//edit: Found a workaround, thanks!

[Modified 5 years ago]

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

Hi Miguel,

I know you already found a solution but I saw your original reply.  The layout file is XML.  If you look at the "DockSiteLayout/ToolWindows" element, you can see each ToolWindow child element has a Name.  Those are all the known tool windows.  You could compare that with the tool windows currently in your app and then take action on those not listed in the XML layout file.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.