Search
Miscellaneous

Associate Custom Data with Items

You can associate custom values from any data type with diagram elements by setting their Tag and Id properties. If the associated data is of a value type or of type that is serializable (marked as [Serializable] and implementing the ISerializable interface), then it is saved and loaded together with the diagram items when the MindFusion.Diagramming diagrams are saved or loaded. The FindNode, FindLink, FindNodeById and FindLinkById methods let you find diagram elements associated with a specific value.

Inspecting Items Geometry

Fluent API

Extension methods in MindFusion.Diagramming.Fluent and MindFusion.Diagramming.Layout.Fluent namespaces let you initialize objects using fluent programming style:

C#  Copy Code

using MindFusion.Diagramming.Fluent;
using MindFusion.Diagramming.Layout.Fluent;
//...

diagram.Factory
    .CreateShapeNode(10, 10, 20, 20)
        .Brush(Color.LightGray)
        .Font("Arial", 12)
        .EnableStyledText(true)
        .Text("Task <i>1</i>")
        .ToolTip("This is the task");

new TreeLayout()
  .LevelDistance(20)
  .NodeDistance(20)
  .LinkStyle(TreeLayoutLinkType.Cascading3)
  .Arrange(diagram);