windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-baseview-d42f2df3.md
Occurs when a saved layout is invalid and cannot be restored. Allows you to fix restore layout exceptions.
Namespace : DevExpress.XtraBars.Docking2010.Views
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
public event EventHandler<RestoreLayoutErrorEventArgs> RestoreLayoutError
Public Event RestoreLayoutError As EventHandler(Of RestoreLayoutErrorEventArgs)
The RestoreLayoutError event's data class is RestoreLayoutErrorEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| Exceptions | Gets the list of exceptions that occurred during the restore layout operation. |
| IsLayoutBroken | Gets whether the layout cannot be restored due to the invalid layout file. |
| Throw | Gets or sets whether to throw exceptions that occur during the restore layout operation. |
The event data class exposes the following methods:
| Method | Description |
|---|---|
| ThrowIfRestoreLayoutExceptionsNotHandled() | For internal use. |
The NonUniqueControlNameException occurs when the restored layout contains documents with duplicate ControlName properties.
Follow the steps below to fix this exception:
RestoreLayoutError event.false to suppress the exception.void tabbedView1_RestoreLayoutError(object sender, DevExpress.Utils.Serializing.RestoreLayoutErrorEventArgs e) {
foreach (var exception in e.Exceptions) {
if (exception is NonUniqueControlNameException nonUniqueException)
nonUniqueException.ControlName = $"{nonUniqueException.ControlName}_1";
}
e.Throw = false;
}
See Also