
We're trying to implement persisting ToolWindows state, location in the DockSite of our application.
We create our ToolWindow view models and assign them to the ToolItemsSource collection property of DockSite. All our tool window view models have a unique SerializationId.
Implementation:
We call the DockSiteLayoutSerializer LoadFromString in the Loaded event of our DockSiteView. And for saving, we have added DockSiteLayoutSerializer SaveToString in the Closing event of our MainWindow.
So the problem is, when we re-open the application the first item in our ToolWindowViewModels collection always gets closed (even if it is added in the saved serialized layout string) triggered by LoadFromString call.
Do you have any idea why the first ToolWindow view model in the collection always gets deleted when LoadFromString is called? Any help would be appreciated.
Thanks,
Gerald