Search
Custom Item Types

You can create your own item types by deriving from the DiagramNode and DiagramLink classes or their successors such as TableNode, ContainerNode, and so on. This lets you add custom data fields to the diagram items, and implement custom visualization and interaction functionality.

Serialization

If you add custom fields to your item class, you will probably want their values saved when saving diagram files, and restored when loading files. To enable this, override the SaveToXml and LoadFromXml methods of the DiagramItem class, which let you serialize the properties in a XDocument object.

Rendering

If you need to provide custom rendering for your items, override the Draw and DrawShadow methods. They receive as an argument an object that implements the IGraphics interface, which provides methods for drawing vector graphics, text and images.

User interaction

To let the user draw items from a custom class, set the Behavior property of the diagram view to Custom, and set the CustomBehavior property to a BaseTouchBehavior-derived instance, which implements the details of the interaction.