Skip to content

DevExpress-Examples/wpf-dock-layout-manager-use-the-layout-upgrade-event-to-upgrade-a-layout-from-one-version-to-another

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Dock Layout Manager - Use the Layout Upgrade Event to Upgrade a Layout from One Version to Another

You may have an application and save/restore its layout. If you change layout settings(show a panel, add another column, rearrange groups, and other), you can override these changes when you restore the layout.

Use the DXSerializer.LayoutUpgrade event and the DXSerializer.LayoutVersion property to maintain changes.

<dxdo:DockLayoutManager
...
dx:DXSerializer.LayoutUpgrade="OnDockLayoutManagerLayoutUpgrade"
dx:DXSerializer.LayoutVersion="2.0"
... />
void OnDockLayoutManagerLayoutUpgrade(object sender, LayoutUpgradeEventArgs e) {
    if (e.RestoredVersion == "1.0") {
        //...
    }
}
Private Sub OnDockLayoutManagerLayoutUpgrade(ByVal sender As Object, ByVal e As LayoutUpgradeEventArgs)
    If e.RestoredVersion = "1.0" Then
        '...
    End If
End Sub

The LayoutUpgrade event is raised if the restored layout version is different from the current LayoutVersion value. You can increase LayoutVersion in a new version of your application and do the required changes in the LayoutUpgrade event handler.

Files to Look At

Documentation