Back to Devexpress

LayoutControl.RestoreLayoutFromXml(String) Method

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-restorelayoutfromxml-x28-system-dot-string-x29.md

latest3.1 KB
Original Source

LayoutControl.RestoreLayoutFromXml(String) Method

SECURITY-RELATED CONSIDERATIONS

Deserializing layout settings from untrusted resources may create security issues. Review the following help topic for additional information: Safe Deserialization.

Restores the layout from the specified XML file.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public virtual void RestoreLayoutFromXml(
    string xmlFile
)
vb
Public Overridable Sub RestoreLayoutFromXml(
    xmlFile As String
)

Parameters

NameTypeDescription
xmlFileString

A String value which specifies the path to the XML file that contains the layout to be loaded. If the specified file doesn’t exist, an exception is raised.

|

Remarks

The RestoreLayoutFromXml method loads a layout that has been saved to a file in XML format using the LayoutControl.SaveLayoutToXml method.

See Save and Restore Layout to learn more.

Example

The code below demonstrates how the layout can be saved to and then restored from an XML file.

csharp
string f = "c:\\Layout.xml";
// Save the layout to an XML file.
layoutControl1.SaveLayoutToXml(f);
// ...
// Restore a previously saved layout.
layoutControl1.RestoreLayoutFromXml(f);
vb
Dim f As String = "c:\Layout.xml"
' Save the layout to an XML file.
LayoutControl1.SaveLayoutToXml(f)
' ...
' Restore a previously saved layout.
LayoutControl1.RestoreLayoutFromXml(f)

See Also

RestoreLayoutFromRegistry(String)

RestoreLayoutFromStream(Stream)

OptionsSerialization

Save and Restore Layouts of DevExpress controls

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace