The ControlNode class lets you use any WPF UIElement object as a diagram node. This allows you to use ready-made or custom WPF controls to display or edit the entities represented in your application's diagrams. The controls hosted in WpfDiagram nodes might be interactive and with embedded user interface. For example you might utilize calendars, grids, rich-text controls or html-pages as entity editors or viewers. You might also create your own custom control and integrate it seamlessly with WpfDiagram; as a result you can get as advanced entity-relationship diagram editor as your application needs.
To let the user draw UIElement objects with the mouse, set Behavior to Custom. The type of controls to be created in the host nodes is specified by the CustomNodeType property of Diagram. If the following code executes, each node drawn by users would host a GridView instance, and nodes could be connected by drawing links between them:
C# Copy Code |
---|
// Draw datagrid nodes and allow connecting them with links |
Visual Basic Copy Code |
---|
' Draw datagrid nodes and allow connecting them with links |