Hi Radslav,
AppStateSerializer does write information into the memory stream correctly. But you need to reset the memory stream’s current position to the beginning or to the point from which the serialized bytes begin before passing it to the AppStateSerializer or calling the LoadDockState method. The AppStateSerializer will have no concept of where the stream begins or ends and it is up to the application to manage the stream. Assuming that this particular stream has just the persisted state information, then setting it’s current position to 0 before calling LoadDockState() will make it work correctly (as shown in the code snippet below) :
// loading dock state information
this.memstream.Position = 0;
AppStateSerializer aser = new AppStateSerializer(SerializeMode.BinaryFmtStream, memstream);
this.dockingManager1.LoadDockState(aser);
// saving dock state information
this.memstream = new MemoryStream();
AppStateSerializer aser = new AppStateSerializer(SerializeMode.BinaryFmtStream, memstream);
this.dockingManager1.SaveDockState(aser);
aser.PersistNow();
Please refer to the
complete sample attached here which illustrates the above, and let me know if you need further assistance.
We appreciate your interest in Syncfusion products.
Regards,
Vijay