Serialize/Deserialize of a docking windowstyle

Docking/MDI for WPF Forum

Posted 9 years ago by Arthur Damen
Version: 10.1.0523
Avatar
Hi,
I created a application with a certain docking window implementation.

Now I created a new docking toolwindow that needs to be shown (code).

When my customer starts the application it does not show the new created toolwindow.
I would aspect that when there is no info inside the saved dock info for a certain new toolwindow, it would show it with the default values.

Comments (5)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

Currently, all ToolWindows must be created and registered with the DockSite before deserializing the layout. In the upcoming release, we have functionality to allow auto-creation and/or lazy loading. In both cases though, you would need to initialize properties like the Title, ImageSource, and Content.


Actipro Software Support

Posted 9 years ago by Arthur Damen
Avatar
Why not checking for existance and if not available in the serialised content, load the default settings as defined in the window. If I do not load the serialised content, i will see the defined window settings.

At this moment if i want my customer to go back to the default settings, he must throw away the settings file.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

I'm not exactly sure what you mean by "load the default settings defined in the window". When deserializing a DockSite, we effectively have two layouts: the current one and the one you are loading from XML. I'm assuming you want to keep open any ToolWindows that are "new" in your application from a previous release. This is something you'd have to explicitly handle in your application.

Trying to merge the two layouts can be very difficult, as each of the layouts can be a complex heirarchy. If you currently have 3 ToolWindows stacked verticaly and load a layout were two of those windows are stacked horizontally, how would you expect the layout to look? Some people may want the 3rd ToolWindow on the top, and the other 2 stacked horizontally on the bottom. Others may want it the other way around, and others may even want the 3rd ToolWindow to be closed. This is actually just one simple example, there are much more complex scenarios.

You can inject custom data into the XML file and read that information back when deserializing. Using this mechanism, you can save a "layout version" so you will know if you are loading an older version of your file. If loading an older version, you can programmatically dock the new ToolWindows where you feel they best fit. Or you could choose to discard the old layout and run with the layout defined in your XAML.

I don't believe the Docking & MDI product has an example of how custom data can be injected, but the Navigation Save/Load Layout QuickStart does show an example. The concept is the same for the DockSite.


Actipro Software Support

Posted 9 years ago by Arthur Damen
Avatar
"I'm assuming you want to keep open any ToolWindows that are "new" in your application from a previous release."

Yes, that's my goal. The customer has changed the look (positions) and would like to keep it that way. When they upgrade and see the default look, they probably are going to complaint.

A second thing is that when I specify a title (english), and after that change the language of the program and restart it, it still shows the english and not the other specified language from a resource. I assume I have to set all titles on startup to prevent this from happening.
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

You would need to set DockSiteLayoutSerializer.CanLoadToolWindowTitles to false. This prevents the DockSiteLayoutSerializer from restoring the Title that was serialzed out. In the upcoming release, we've removed the Title from the layout file because of issues like this, so you won't need to set that option.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.