ComponentOne DashboardLayout for WinForms
XML Serialization
Work with DashboardLayout > XML Serialization

Serialization refers to converting an object into a stream of bytes. The purpose of serialization is to save the current state of an object so that it can be recreated when required. DashboardLayout supports serialization through SaveLayout and LoadLayout methods of the C1DashboardLayout class. The SaveLayout method saves the DashboardLayout layout properties, i.e., order and bounds of child containers, to an XML stream or file. The LoadLayout method loads the DashboardLayout layout properties from an XML stream or file.

The following code shows the example of saving and loading the DashboardLayout to and from an XML file:

c1DashboardLayout1.SaveLayout(“DashboardLayout.xml");
c1DashboardLayout1.LoadLayout(“DashboardLayout.xml");

The following code shows example of saving and loading the DashboardLayout to and from an XML stream:

MemoryStream  stream = new MemoryStream();
c1DashboardLayout1.SaveLayout(stream);
stream.Seek(0, SeekOrigin.Begin);
c1DashboardLayout1.LoadLayout(stream);