You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,20 @@
7
7
8
8
# WPF Dock Layout Manager – Upgrade the Application Layout Between Versions
9
9
10
-
This example allows you to save and restore layouts and change the layout structure across different versions of the app.
10
+
When you change the application layout (for example, adding new panels, enabling MDI mode, or rearranging groups) previously saved layouts may become outdated or incompatible. This example saves and restores layouts while supporting structural changes across different versions of the application.
11
11
12
-

13
-
14
-
When the layout changes (for example, panels are added, MDI mode is introduced, or groups are rearranged), previously saved layouts may become outdated or incomplete. This example helps you to do the following:
12
+
Use this example to:
13
+
* Detect the version of the layout being restored.
14
+
* Apply upgrade logic to adjust the layout for both [`DockLayoutManager`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.DockLayoutManager) and nested controls like [`GridControl`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Grid.GridCell.GridControl).
15
+
* Preserve backward compatibility while keeping layouts aligned with the current application structure.
15
16
16
-
- Detect the layout version being restored.
17
-
- Apply conditional upgrade logic for both [`DockLayoutManager`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.DockLayoutManager) and nested controls (such as [`GridControl`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Grid.GridCell.GridControl)).
18
-
- Ensure backward compatibility and keep your layout flexible and up to date.
17
+

19
18
20
19
## Implementation Details
21
20
22
21
### Version Management
23
22
24
-
The [`DXSerializer.LayoutVersion`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutVersion) property marks the version of the current layout. The [`ComboBoxEdit`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Editors.ComboBoxEdit) control allows you to change this version at runtime:
23
+
The [`DXSerializer.LayoutVersion`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutVersion) property specifies the version of the current layout. In this example, the [`ComboBoxEdit`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Editors.ComboBoxEdit) control allows the user to change the current layout version:
@@ -32,7 +31,7 @@ The [`DXSerializer.LayoutVersion`](https://docs.devexpress.com/WPF/DevExpress.Xp
32
31
33
32
### Save and Restore Layouts
34
33
35
-
Save and restore the layout through the [`WorkspaceManager`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.WorkspaceManager). The manager writes the layout to disk as an XML file and can reapply it later:
34
+
Use the [`WorkspaceManager`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.WorkspaceManager) component to save the application layout to an XML file and restore it when needed:
When the restored layout comes from an older version, custom upgrade handlers are triggered through the [`DXSerializer.LayoutUpgrade`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutUpgradeEvent) event.
45
+
When a layout from an older version is restored, the [`GridControl`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Grid.GridCell.GridControl) and `DockLayoutManager` raise the [`DXSerializer.LayoutUpgrade`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Core.Serialization.DXSerializer.LayoutUpgrade) event to apply custom upgrade logic and adapt the layout to the current version of the application.
47
46
48
47
* For the [`DockLayoutManager`](https://docs.devexpress.com/WPF/DevExpress.Xpf.Docking.DockLayoutManager), the handler switches the MDI style if the layout version is `"1.0"`:
0 commit comments