Represents a group of items in the diagram document.
Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf
C# Copy Code |
---|
public class Group |
Visual Basic Copy Code |
---|
Public Class Group |
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 must have a single master item, to which all group members are attached. The master item can be accessed by the MainItem property. The group of items attached to an item is accessed by the SubordinateGroup property of the latter. MasterGroup gets the group in which a node 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 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 the Detach method.
The Expandable property specifies whether expanding or collapsing a tree is propagated from the master node through the subordinated nodes. FollowMasterRotation can be used when the master item is a node. If it is enabled, the positions of attached nodes are updated to reflect the RotationAngle of the master 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.
System.Object
MindFusion.Diagramming.Wpf.Group