Saving layout to a stream then converting the stream to a base 64 string which is saved to a user setting. When restoring the string is read from the user setting then converted to a byte array which is used to create a stream that is passed into the
RestoreLayout method. I've tried restoring the layout using different event handlers but I always get the error below. I've tried the window OnLoad, OnInitialized even the docking manager OnLoaded.
"Unable to deserialize a docking layout while DockingManager control is unloaded"
at AvalonDock.DockingManager.RestoreLayout(XmlDocument doc)
at AvalonDock.DockingManager.RestoreLayout(Stream backendStream)