We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SaveDockState

I don''t want to use PersistSate property. I''ve tried to put this code: _dockingManager.SaveDockState(); AppStateSerializer.GetSingleton().PersistNow(); in OnClosed and in OnClosing method. and in both cases the layout information is not written. But when I put the same code in Form1_DoubleClick event handler information is saved. So, what is the right place to put calling of DockingManager.SaveDockState method?

3 Replies

VS Vijayanand S Syncfusion Team December 21, 2005 03:47 PM UTC

Hi Andrey, NewDockStateEndLoad event and Form Closing event is the better place to load and save the dock state respectively. Do you load your dock state in form load event? If yes, Please call the LoadDockState method in the NewDockStateEndLoad event. This event will trigger after the form load event. Please take a look at the sample and let me know if this meets your requirement. Thank you for using Syncfusion products. Regards, Vijay Test Sample


AD Administrator Syncfusion Team December 12, 2008 04:23 PM UTC

I am using AppStateSerializer.PersistNow in my application for saving docking manager state. (I created an instance of it myself)

- The "DockingManager.SaveDockState" call is made in the FormClosing event of my form
- The AppStateSerializer.PersistNow is called just after.
Due to "class and method" organization the AppStateSerializer.PersistNow was in fact called twice , in this case my file (Xml) was nearly empty (2ko), but when I changed my code for it to be called only once, my file was Ok, trapping in the debugger showed that the second call to "AppStateSerializer.PersistNow" would "damage" the file, the file would pass from 28Ko to 2ko
Any explanations , Have i done something wrong ?





AD Administrator Syncfusion Team December 18, 2008 07:34 AM UTC

Hi Eric,

Sorry for the delayed response.

AppStateSerializer PersistNow() called twice

I am afraid that I was not able to see that the AppStateSerializer PersistNow() method is called twice in debug mode. Please provide me more details and the Essential Studio version you are using.

Please let me know if any concern.

Regards,
Jaya


Loader.
Live Chat Icon For mobile
Up arrow icon