Class GroupManager
Manages group operations including auto-sizing, collapse state, and drag-to-add.
public class GroupManager
- Inheritance
-
GroupManager
- Inherited Members
Constructors
GroupManager(IGraphContext, CommandHistory, FlowCanvasSettings)
Creates a new group manager.
public GroupManager(IGraphContext context, CommandHistory commandHistory, FlowCanvasSettings settings)
Parameters
contextIGraphContextThe graph context providing access to the current graph.
commandHistoryCommandHistoryThe command history for undo/redo support.
settingsFlowCanvasSettingsThe canvas settings.
GroupManager(Func<Graph?>, CommandHistory, FlowCanvasSettings)
[Obsolete("Use the constructor that accepts IGraphContext instead.")]
public GroupManager(Func<Graph?> getGraph, CommandHistory commandHistory, FlowCanvasSettings settings)
Parameters
getGraphFunc<Graph>commandHistoryCommandHistorysettingsFlowCanvasSettings
Properties
GroupPadding
Padding around children when calculating group bounds.
public double GroupPadding { get; set; }
Property Value
HeaderHeight
Height of the group header.
public double HeaderHeight { get; set; }
Property Value
Methods
AddNodesToGroup(string, IEnumerable<string>)
Adds nodes to an existing group.
public void AddNodesToGroup(string groupId, IEnumerable<string> nodeIds)
Parameters
groupIdstringnodeIdsIEnumerable<string>
AutoResizeGroup(string)
Auto-resizes a group to fit its children with padding.
public void AutoResizeGroup(string groupId)
Parameters
groupIdstring
CollapseAll()
Collapses all groups in the graph.
public void CollapseAll()
CreateGroup(IEnumerable<string>, string?)
Creates a group from the specified nodes.
public Node? CreateGroup(IEnumerable<string> nodeIds, string? label = null)
Parameters
nodeIdsIEnumerable<string>labelstring
Returns
ExpandAll()
Expands all groups in the graph.
public void ExpandAll()
GetAllGroups()
Gets all groups in the graph.
public IEnumerable<Node> GetAllGroups()
Returns
GetGroupAtPoint(Point)
Checks if a point is inside a group's drop zone.
public string? GetGroupAtPoint(Point canvasPoint)
Parameters
canvasPointPoint
Returns
GetGroupChildren(string)
Gets the children of a group.
public IEnumerable<Node> GetGroupChildren(string groupId)
Parameters
groupIdstring
Returns
GetVisibleEdges()
Gets all visible edges (excluding those with hidden endpoints).
public IEnumerable<Edge> GetVisibleEdges()
Returns
GetVisibleNodes()
Gets all visible nodes (excluding those hidden by collapsed groups).
public IEnumerable<Node> GetVisibleNodes()
Returns
HandleNodeDroppedOnGroup(IEnumerable<string>, Point)
Handles dropping nodes onto a group.
public bool HandleNodeDroppedOnGroup(IEnumerable<string> nodeIds, Point dropPoint)
Parameters
nodeIdsIEnumerable<string>dropPointPoint
Returns
IsNodeVisible(string)
Checks if a node is visible (not hidden by a collapsed parent group).
public bool IsNodeVisible(string nodeId)
Parameters
nodeIdstring
Returns
RemoveNodesFromGroup(IEnumerable<string>)
Removes nodes from their parent group.
public void RemoveNodesFromGroup(IEnumerable<string> nodeIds)
Parameters
nodeIdsIEnumerable<string>
SetCollapsed(string, bool)
Sets the collapsed state of a group.
public void SetCollapsed(string groupId, bool collapsed)
Parameters
ToggleCollapse(string)
Toggles the collapsed state of a group.
public void ToggleCollapse(string groupId)
Parameters
groupIdstring
Ungroup(string)
Ungroups the specified group.
public void Ungroup(string groupId)
Parameters
groupIdstring
Events
GroupCollapsedChanged
Event raised when a group's collapsed state changes.
public event EventHandler<GroupCollapsedEventArgs>? GroupCollapsedChanged
Event Type
GroupRerenderRequested
Event raised when a group needs to be re-rendered.
public event EventHandler<string>? GroupRerenderRequested
Event Type
NodesAddedToGroup
Event raised when nodes are added to a group.
public event EventHandler<NodesAddedToGroupEventArgs>? NodesAddedToGroup