[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]MVVM Framework
    Getting Started
    Services in ViewModelBase descendants
    Services in POCO objects
    Services in custom ViewModels
    View creation mechanisms
   [Collapse]Predefined Set
    [Expand]Dialog Services
    [Expand]Message Box Services
    [Expand]Document Services
    [Expand]Report Services
    How to create a Custom Service
   Data Annotation Attributes
   Weak Event
 [Expand]Controls and Libraries
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


LayoutSerializationService is an ILayoutSerializationService implementation that allows you to save/restore layout of serializable DevExpress WPF Controls located on a View.(i.e., DXGrid, DXPivotGrid, DXDocking, DXBars and DXLayoutControl).

Expanded Getting Started with the LayoutSerializationService

To save/restore a layout of your View and its child element, add the LayoutSerializationService to the View's dxmvvm:Interaction.Behaviors collection.

Then, use one of the following ways to access the defined service.

Next, call the service's Serialize/Deserialize method to save/restore the View's layout respectively. The Serialize method returns a string object that contains layout settings that you can restore by using the Deserialize method in the sequel. To restore a specific layout, pass the corresponding string object to the Deserialize method using its parameter.

When the Serialize/Deserialize method is invoked, the LayoutSerializationService iterates through visual tree elements and saves/restores the layout of controls supporting serialization and their child elements by using the DevExpress.Xpf.Core.Serialization.DXSerializer methods. Therefore, to properly perform serialization and deserialization, follow the recommendations described in the Saving and Restoring Layout Basics thread.


If you use LayoutSerializationService in conjunction with CurrentWindowSerializationBehavior, use the Initialized event to deserialize the layout on the application startup. Otherwise, the window may flicker during the deserialization.

Expanded Serialization Capabilities

To prevent a specific control and its child elements from being serialized/deserialized, set the attached dx:DXSerializer.Enabled property to False for this control.

Expanded Example

Expanded See Also

Is this topic helpful?​​​​​​​