Skip to main content

DiagramCustomGetEditableItemPropertiesEventArgs.CreateProxyProperty(PropertyDescriptor, Func<IDiagramItem, Object>, IEnumerable<Attribute>) Method

Allows you to create a custom property descriptor.

Namespace: DevExpress.Xpf.Diagram

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

NuGet Package: DevExpress.Wpf.Diagram

Declaration

public PropertyDescriptor CreateProxyProperty(
    PropertyDescriptor property,
    Func<IDiagramItem, object> getObject,
    IEnumerable<Attribute> additionalAttributes = null
)

Parameters

Name Type
property PropertyDescriptor
getObject Func<DevExpress.Diagram.Core.IDiagramItem, Object>

Optional Parameters

Name Type Default Description
additionalAttributes IEnumerable<Attribute> null

A collection of property attributes.

Returns

Type Description
PropertyDescriptor

The property descriptor that can be added to the Properties collection.

Remarks

Use the CreateProxyProperty method to allow users to edit properties that are not defined directly at the diagram item level. This can be useful when your diagram is bound to a data source and you need to edit data item properties.

See the example below.

 private void DiagramDesignerControl_CustomGetEditableItemProperties(object sender,
        DevExpress.Xpf.Diagram.DiagramCustomGetEditableItemPropertiesEventArgs e) {
    if (e.Item is DiagramShape)
    {
        PropertyDescriptor namePropertyDescriptor = e.CreateProxyProperty("Name", item => ((Customer)item.DataContext).Name, (item, value) => ((Customer)item.DataContext).Name = value);
        e.Properties.Add(namePropertyDescriptor);
    }
}
See Also