Skip to content

Commit d1d7c72

Browse files
Add changes after review (fresh eye)
1 parent dc66e81 commit d1d7c72

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Readme.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,20 @@
77

88
# WPF Dock Layout Manager – Upgrade the Application Layout Between Versions
99

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.
1111

12-
![Upgrade the Application Layout Between Versions](./Images/restore-version.jpg)
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.
1516

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+
![Upgrade the Application Layout Between Versions](./Images/restore-version.jpg)
1918

2019
## Implementation Details
2120

2221
### Version Management
2322

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:
2524

2625
```xaml
2726
<dxe:ComboBoxEdit EditValue="{Binding ElementName=dockLayoutManager, Path=(dx:DXSerializer.LayoutVersion)}">
@@ -32,7 +31,7 @@ The [`DXSerializer.LayoutVersion`](https://docs.devexpress.com/WPF/DevExpress.Xp
3231

3332
### Save and Restore Layouts
3433

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:
3635

3736
```csharp
3837
manager.CaptureWorkspace("TestWorkspace");
@@ -43,7 +42,7 @@ manager.ApplyWorkspace("TestWorkspace");
4342

4443
### Upgrade Logic
4544

46-
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.
4746

4847
* 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"`:
4948

0 commit comments

Comments
 (0)