Represents an item in the diagram document. All classes representing diagram elements derive from DiagramItem.
Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming
C# Copy Code |
---|
public abstract class DiagramItem : IPersists, IDisposable, InplaceEditable |
Visual Basic Copy Code |
---|
Public MustInherit Class DiagramItem |
All items in the diagram document - links and nodes - share common base class called DiagramItem. Its main function is to provide interface for the most common methods and properties of every diagram element.
MindFusion.Diagramming invokes the Draw method when an item must be drawn on screen. You can call Draw if you need to draw an item on your own graphics surface. Override the method when implementing custom item types to provide your own rendering functionality. The standard item types draw their interior and borders using the objects assigned to the Brush and Pen properties. The font of the item's text is set by the Font property.
The order in which items are painted from bottom to top is called the z-order. Moving items up or down the z-order can be done by means of the ZBottom, ZTop, ZLevelUp and ZLevelDown methods. Accessing and setting the index of an item in the z-order can be done using the ZIndex property.
A hierarchy of items can be built, so that moving an item that is higher in the hierarchy moves all subordinated items too. The immediate subordinates of an item are represented by a Group instance. The group of items attached to another item is accessed through the SubordinateGroup property of the latter. MasterGroup gets the group in which an item is subordinate.
Every item can cast a shadow, whose offset from the item is specified by the ShadowOffsetX and ShadowOffsetY properties. The shadow is painted using the color set in ShadowBrush.
An application can associate custom data with an item by means of the Tag property. The tags are only meant to hold data related to the entities represented by the chart items. They are not used or modified by MindFusion.Diagramming in any way. The tags are saved and loaded together with the diagram elements when serializing the document to a disk file or a stream.
Items can be locked for interactive modification through the Locked property. Locked items can still be modified programmatically. Items can also be marked as locked for automatic layout methods through the IgnoreLayout property.
System.Object
MindFusion.Diagramming.DiagramItem
MindFusion.Diagramming.DiagramLink
MindFusion.Diagramming.DiagramNode
MindFusion.Diagramming.Selection