Diagram elements in Diagramming for WinUI are represented by ShapeNode, ContainerNode, TableNode, ControlNode and DiagramLink instances. Combined and linked together, they can form complex data structures such as process or entity-relationship diagrams, class hierarchies, networks and graphs. Each of their rich features can be customized through numerous methods and properties.
Shape nodes can represent geometric shapes, flowchart elements, icons in network diagrams, and so on. They can display both graphics and text in different fonts, sizes and colors. There are more than 100 predefined node shapes and apart from them, Diagramming for WinUI offers an easy way to define custom shapes. ShapeNode appearance can be customized further by adding UIElement-derived objects to the Canvas contained in each node.
Tables can be used to represent table schemas in database diagrams or classes in class-hierarchies. A table contains cells arranged in a grid, and every cell can display text and/or image. Cells, columns and rows can be customized in various ways - there are properties available for setting their extents, style, image and text alignment. Tables' dimensions can be programmatically changed; inserting, appending or deleting rows and columns can be done in a very comprehensive, intuitive way whenever you might need it. Tables can also display background images and graphics.
A ContainerNode can contain other diagram nodes. When a container is moved, the contained nodes move too. Containers can be folded to hide the contained nodes, and unfolded back to show them again. Nodes inside a container can be linked to nodes both inside and outside of it. When a container is folded, the links connecting its children with outside nodes align to the container's outlines. Containers can be nested within each other to unlimited depth.
A ControlNode can host any WinUI 3 control. The hosted control might be any of the standard WinUI 3 types such as DataGrid or Button. Custom controls are also supported. A ControlNode can be connected with links to any other nodes - control nodes, shapes or tables.
The TreeViewNode class represents nodes that can display hierarchical data. The root items displayed in the node can be accessed through the RootItems property. New items can be added to and removed from the returned collection. The root items can have child items on their own and so on. For more information, refer to the TreeViewItem class.
Links are used to represent various types of connections and relations in diagrams. Diagramming for WinUI offers three basic link types:
A link can be connected to a node at each of the link's ends. It is also possible to have unconnected links - having one or both of their ends not connected to nodes. Some customizable link's properties are: arrowheads, shape, text, stroke and stroke thickness , modification behavior and number of segments.