Search
Diagram Class
Remarks See Also
 






The Diagram class represents a flow diagram.

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming

 Syntax

C#  Copy Code

public class Diagram : DiagramBase, IZoomTarget

Visual Basic  Copy Code

Public Class Diagram
    Inherits DiagramBase
    Implements IZoomTarget

 Remarks

A diagram can contain connected nodes and links. Nodes are instances of DiagramNode-derived classes. Nodes are stored in the Nodes collection. Links in MindFusion.Diagramming are instances of the DiagramLink class and are stored in the Links collection.

Managing Items

Items can be created by using the new operator and added to the diagram by means of the Add method of the Nodes or Links collection. Items are deleted by using the Remove method of the respective collection. There are shortcut methods provided by the diagram's Factory object that can be used to create an item and add it to the diagram with just one method call. Use the CreateTableNode, CreateShapeNode, CreateTreeViewNode and CreateDiagramLink factory methods to create new items of the respective type.

Serialization

Use the SaveToXml and LoadFromXml methods to serialize a diagram into/from XML documents on disk on in memory. Handle SerializeTag and DeserializeTag to implement serialization of custom data assigned to the Tag property of items.

Controlling Users' Actions

The Behavior property specifies how the control responds to user actions with the mouse. To use a custom behavior class, set the CustomBehavior property.

Users actions can be validated by handling various events, fired while items are being created, modified or deleted.

The following properties control whether the user is allowed to do some kinds of actions: AllowInplaceEdit, AllowMultipleResize, AllowUnconnectedLinks.

The order in which items are hit-tested when clicking on them depends on the value of HitTestPriority.

 Inheritance Hierarchy

System.Object
    Windows.UI.Xaml.DependencyObject
        Windows.UI.Xaml.UIElement
            Windows.UI.Xaml.FrameworkElement
                Windows.UI.Xaml.Controls.Control
                    Windows.UI.Xaml.Controls.ContentControl
                        MindFusion.Diagramming.DiagramBase
                            MindFusion.Diagramming.Diagram
                                MindFusion.Diagramming.DiagramPage
                                MindFusion.Diagramming.VirtualizingDiagram

 See Also