Skip to main content
A newer version of this page is available. .
All docs
V21.2

DXSerializer.BeforeLoadLayout Attached Event

Occurs before the DXSerializer loads a layout from an XML file/Stream.

Namespace: DevExpress.Xpf.Core.Serialization

Assembly: DevExpress.Xpf.Core.v21.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

Remarks

Do the following to prevent a layout from being restored (deserialized):

  1. Handle the BeforeLoadLayout event.
  2. Set the BeforeLoadLayoutEventArgs.Allow event argument to false.
using DevExpress.Utils.Serializing;
using DevExpress.Xpf.Core.Serialization;
using DevExpress.Xpf.Grid;
using DevExpress.Xpf.Core;
// ...

public partial class MainWindow : Window {
    public MainWindow() {
        //...
        grid.AddHandler(DXSerializer.BeforeLoadLayoutEvent, new BeforeLoadLayoutEventHandler(BeforeLoadLayoutEvent));
    }

    void BeforeLoadLayoutEvent(object sender, BeforeLoadLayoutEventArgs e) {
        e.Allow = false;
    }
}
See Also