Skip to main content
All docs
V25.1
  • DXSerializer.Deserialize(DependencyObject, Object, String, DXOptionsLayout) Method

    Restores (deserializes) layouts of the specified container (or control) and all its child elements from the XML file.

    Namespace: DevExpress.Xpf.Core.Serialization

    Assembly: DevExpress.Xpf.Core.v25.1.dll

    NuGet Package: DevExpress.Wpf.Core

    Declaration

    public static void Deserialize(
        DependencyObject root,
        object path,
        string appName = "",
        DXOptionsLayout options = null
    )

    Parameters

    Name Type Description
    root DependencyObject

    A container (or a control) whose layouts should be restored.

    path Object

    The target XML file’s path.

    Optional Parameters

    Name Type Default Description
    appName String String.Empty

    The application name.

    options DXOptionsLayout null

    Settings that specify whether the container’s child object layouts should be deserialized.

    Remarks

    Call this method to restore (deserialize) layouts of a container (Window, View, UserControl) and its child controls from an XML file.

    The following code restores the layout of the mainWindow and its child GridControls from the XML file:

    <Window . . .
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
        x:Name="mainWindow">
        <Grid>
            <dxg:GridControl dx:DXSerializer.SerializationID="gridControl1">
                <!--...-->
            </dxg:GridControl>
            <dxg:GridControl dx:DXSerializer.SerializationID="gridControl2">
                <!--...-->
            </dxg:GridControl>
        </Grid>
    </Window>
    
    using DevExpress.Xpf.Core.Serialization;
    
    private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
        DXSerializer.Deserialize(mainWindow, "Layout.xml");
    }
    

    The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Deserialize(DependencyObject, Object, String, DXOptionsLayout) method.

    Note

    The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

    See Also