Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

LayoutControlBase.WriteToXML(XmlWriter) Method

Saves the layout of items that reside within the current object.

Namespace: DevExpress.Xpf.LayoutControl

Assembly: DevExpress.Xpf.LayoutControl.v24.2.dll

NuGet Package: DevExpress.Wpf.LayoutControl

#Declaration

public virtual void WriteToXML(
    XmlWriter xml
)

#Parameters

Name Type Description
xml XmlWriter

A System.Xml.XmlWriter object to which data will be written.

#Remarks

You can save the layout of child items via the WriteToXML method. The LayoutControlBase.ReadFromXML method allows you to load the previously saved layout.

Note

When saving/loading layouts to a data store, only properties that can be changed by an end-user during layout customization are stored/restored. If you need to save/load custom properties, handle the LayoutControl.WriteElementToXML and LayoutControl.ReadElementFromXML events.

Note

The orientation of items within the group whose LayoutGroup.View property is set to LayoutGroupView.Group is not saved.

Note

To correctly save and then restore the layout of items, you need to assign names to the items. If names are not specified, the layout will be correctly restored, provided that the LayoutControl’s/LayoutGroup’s item collection (the order and number of items) wasn’t modified after the layout was saved.

To load a layout, we recommend using the Loaded event of a UserControl or a window.

See Also