ASP.NET Pack Programmer's Guide
Group Class
Remarks See Also
 





Represents a group of items in the diagram document.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public class Group : IPersists

Visual Basic  Copy Code

Public Class Group
    Implements IPersists

 Remarks

An 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. Every group should have a single master item, to which all group members are attached. The master item can be accessed from the MainItem property. The group of items attached to an item is accessed through the SubordinateGroup property of the latter. MasterGroup gets the group in which an item is subordinate.

To create a group, instantiate a Group object and add it to the diagram's Groups collection, or call the CreateGroup method passing the master item as argument. A group is automatically destroyed when its master item is deleted.

To destroy a group programmatically, call the Remove method of the Groups collection. If AutoDeleteItems is enabled, subordinated items in the group are deleted too. If AutoDeleteItems is disabled, subordinated items are just detached from their master and remain intact.

Nodes can be attached to a group in several ways, depending on the type of the master item. If the master is a node, other nodes can be attached by calling the AttachProportional or AttachToCorner methods. If the master is a link, nodes can be attached to it using the AttachToLinkSegment or AttachToLinkPoint methods. The DiagramNode class provides a shortcut AttachTo method, which creates a group if necessary and calls the group's appropriate AttachTo* method. Items can be detached from a group by calling the Detach method.

The Expandable property specifies whether expanding or collapsing a tree should propagate from the master node through the subordinated nodes. FollowMasterRotation can be used when the master node is a shape node. If it is enabled, the positions of the subordinated nodes are updated to reflect the RotationAngle of the shape node while it is rotated.

The Tag property allows attaching custom data to any group. The FindGroup methods looks for a groups having a specific tag.

 Inheritance Hierarchy

System.Object
    MindFusion.Diagramming.Group

 See Also

Group Members
MindFusion.Diagramming Namespace