Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DiagramControl.CustomGetSerializableItemProperties Event

Allows you to modify the list of serializable properties of diagram items.

Namespace: DevExpress.Xpf.Diagram

Assembly: DevExpress.Xpf.Diagram.v24.2.dll

NuGet Package: DevExpress.Wpf.Diagram

#Declaration

public event EventHandler<DiagramCustomGetSerializableItemPropertiesEventArgs> CustomGetSerializableItemProperties

#Event Data

The CustomGetSerializableItemProperties event's data class is DiagramCustomGetSerializableItemPropertiesEventArgs. The following properties provide information specific to this event:

Property Description
ItemType Returns the serialized item type.
Properties Returns the collection of serializable properties.
SerializationKind Indicates the context of serialization.

The event data class exposes the following methods:

Method Description
CreateProxyProperty(PropertyDescriptor, Func<IDiagramItem, Object>, IEnumerable<Attribute>) Allows you to create a custom property descriptor.
CreateProxyProperty<TProperty>(String, Func<IDiagramItem, TProperty>, Action<IDiagramItem, TProperty>, IEnumerable<Attribute>) Allows you to create a custom property descriptor.

#Remarks

The event’s Properties member provides access to the collection of serializable item properties.

The example below illustrates how to exclude the DiagramContentItem.Content property from serialization.

private void diagram_CustomGetSerializableItemProperties(object sender, DiagramCustomGetSerializableItemPropertiesEventArgs e) {
    if (typeof(DiagramContentItem).IsAssignableFrom(e.ItemType))
        e.Properties.Remove(e.Properties["Content"]);
}
See Also