Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 4 KB

File metadata and controls

63 lines (44 loc) · 4 KB

WPF Dock Layout Manager - Serialize Custom Panels and Their Properties

This example saves and restores custom panels and its properties.

This example contains a custom panel derived from the LayoutPanel:

class MyCustomPanel : LayoutPanel {
   ...
}

To mark some panel properties as serializable, you can apply the XtraSerializablePropertyAttribute to the setters of corresponding properties. Target properties can be a dependency or an attached type:

[DevExpress.Utils.Serializing.XtraSerializableProperty]
public int Prop1 { get; set; }
...
[DevExpress.Utils.Serializing.XtraSerializableProperty]
public static int GetProp2(DependencyObject obj) {
   return (int)obj.GetValue(Prop2Property);
}

The CustomSerializationController class extends the DockLayoutManager serialization logic when you need to create new panels when you restore a layout.

To inject the CustomSerializationController class in the DockLayoutManager, you can override the CreateSerializationController() method.

Files to Look At

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)