Skip to content

DevExpress-Examples/wpf-dock-layout-manager-serialize-custom-panels-and-their-properties

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

This example saves and restores custom panels and it's properties.

Topics

Resources

License

Stars

Watchers

Forks