In the provided sample, if I drag the App.xaml.cs document and dock it to the bottom of the Mainwindow.xaml document, save the state, close the app, re-open the app, then load the state, it does not show up anymore.
"
Since after closing the application, the dynamically added children are removed from the children collection of DockingManager."
I'm calling SaveLayout() in the OnSuspending override in my App class. The children are still in the collection at that point.
In OnSuspending:
I call SaveLayout()
I foreach through the children collection, adding their ViewModels to a list.
I then serialize the list with JSON.NET
When I load the app:
Deserialize the list of view models, adding their views to the Children collection.
call LoadLayout()
Sometimes this works, other times the the widgets mix up their places, other times nothing displays at all (even though they are in the children collection).