Back to Devexpress

BaseAppearanceCollection.SaveLayoutToXml(String) Method

windowsforms-devexpress-dot-utils-dot-baseappearancecollection-dot-savelayouttoxml-x28-system-dot-string-x29.md

latest3.1 KB
Original Source

BaseAppearanceCollection.SaveLayoutToXml(String) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Saves the appearance settings to a specific XML file.

Namespace : DevExpress.Utils

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

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

Parameters

NameTypeDescription
xmlFileString

A string value specifying the path to the file in which the appearance settings should be stored. If an empty string is specified, an exception is raised.

|

Remarks

Use the SaveLayoutToXml method to save the activated appearance settings to an XML file at runtime. The appearance settings are activated if their corresponding options are enabled. You can then restore the saved settings using the BaseAppearanceCollection.RestoreLayoutFromXml method.

Example

The following example shows how to read and write the appearance settings used to paint the XtraGrid’s elements to/from an XML file.

csharp
string fileName = "C:\\appearanceLayout.xml";
gridControl1.MainView.Appearance.SaveLayoutToXml(fileName);
// ...
gridControl1.MainView.Appearance.RestoreLayoutFromXml(fileName);
vb
Dim fileName As String = "C:\appearanceLayout.xml"
GridControl1.MainView.Appearance.SaveLayoutToXml(fileName)
' ...
GridControl1.MainView.Appearance.RestoreLayoutFromXml(fileName)

See Also

RestoreLayoutFromXml(String)

SaveLayoutToRegistry(String)

SaveLayoutToStream(Stream)

Save and Restore Layouts of DevExpress controls

BaseAppearanceCollection Class

BaseAppearanceCollection Members

DevExpress.Utils Namespace