Class SelectionManager
Manages selection state for nodes and edges in the flow canvas.
public class SelectionManager
- Inheritance
-
SelectionManager
- Inherited Members
Constructors
SelectionManager(IGraphContext, Func<CanvasElementManager>, Func<ThemeResources>, CommandHistory)
Creates a new selection manager.
public SelectionManager(IGraphContext context, Func<CanvasElementManager> getRenderer, Func<ThemeResources> getTheme, CommandHistory commandHistory)
Parameters
contextIGraphContextThe graph context providing access to the current graph.
getRendererFunc<CanvasElementManager>Function to get the graph renderer.
getThemeFunc<ThemeResources>Function to get the current theme.
commandHistoryCommandHistoryThe command history for undo/redo support.
SelectionManager(Func<Graph?>, Func<CanvasElementManager>, Func<ThemeResources>, CommandHistory)
[Obsolete("Use the constructor that accepts IGraphContext instead.")]
public SelectionManager(Func<Graph?> getGraph, Func<CanvasElementManager> getRenderer, Func<ThemeResources> getTheme, CommandHistory commandHistory)
Parameters
getGraphFunc<Graph>getRendererFunc<CanvasElementManager>getThemeFunc<ThemeResources>commandHistoryCommandHistory
Properties
HasSelection
Gets whether any items are selected.
public bool HasSelection { get; }
Property Value
Methods
DeleteSelected()
Deletes all selected nodes, edges, and shapes.
public void DeleteSelected()
DeselectAll()
Deselects all nodes, edges, and shapes.
public void DeselectAll()
GetSelectedEdges()
Gets all selected edges.
public IEnumerable<Edge> GetSelectedEdges()
Returns
GetSelectedNodes()
Gets all selected nodes.
public IEnumerable<Node> GetSelectedNodes()
Returns
GetSelectedShapes()
Gets all selected shapes.
public IEnumerable<ShapeElement> GetSelectedShapes()
Returns
HandleEdgeClicked(Edge, bool)
Handles edge click to update selection state.
public void HandleEdgeClicked(Edge clickedEdge, bool ctrlHeld)
Parameters
NotifySelectionMayHaveChanged()
Notifies that the selection may have changed (called by external code).
public void NotifySelectionMayHaveChanged()
SelectAll()
Selects all selectable elements (nodes, edges, and shapes) in the graph.
public void SelectAll()
Events
EdgeRerenderRequested
Event raised when edges need to be re-rendered after selection changes.
public event EventHandler? EdgeRerenderRequested
Event Type
SelectionChanged
Event raised when the selection changes.
public event EventHandler<SelectionChangedEventArgs>? SelectionChanged