How to prevent DockingManager from saving state automatically?


I am setting the PersistState = false and still DockingManager saves the state to the serializer when the form is closing.
I am using AppStateSerializer as a singleton, with binary file mode.
I can prevent this from happening by disabling the serializer, but I am hoping there is a way to have the DockingManager save state only when I call SaveDockState().

Thanks with anticipation

Razvan

2 Replies

AD Administrator Syncfusion Team January 6, 2010 09:53 AM UTC

I've never seen it do what you want, why would you keep the serializer open when your are not using it?

I just have a load and save rountine that creates the serializer and then loads/saves, no need to keep a handle to the serializer at all.

ie


Dim memOutput As New IO.MemoryStream()
Try
Dim objDockSerializer As New Syncfusion.Runtime.Serialization.AppStateSerializer(Syncfusion.Runtime.Serialization.SerializeMode.XMLFmtStream, memOutput)
If TabbedManager Then
MainForm.TabbedMDIManager.SaveTabGroupStates(objDockSerializer)
Else
MainForm.DockingManager.SaveDockState(objDockSerializer)
End If
objDockSerializer.PersistNow()
Return memOutput.GetBuffer()
Catch ex As Exception
Return Nothing
Finally
'Always attempt to close the memorystream
Try
memOutput.Close()
Catch
End Try
End Try



GS Githanjali S Syncfusion Team January 6, 2010 12:05 PM UTC

Hi Razvan,

Please refer to the sample attached.

In the sample only when the PersistState=true the DockingManager saves the state to the serializer.

Please let me if you have any questions.

Regards,
Githanjali



Sample_c88db64b.zip

Loader.
Up arrow icon