How miroiu/nodify works
Purpose and Entry Points
Nodify is a C#/WPF control library for MVVM-oriented node-graph editors, packaged as Nodify/Nodify.csproj. Its primary public surface is the editor control stack, not a standalone application. Runnable WPF reference implementations start through each example’s App.xaml and MainWindow.xaml, notably Examples/Nodify.Playground/App.xaml, Examples/Nodify.Workflow/App.xaml, and Examples/Nodify.StateMachine/App.xaml.
Editor Canvas and Interaction Orchestration
NodifyEditor is the interaction coordinator: it hosts graph items on NodifyCanvas and partitions editing behavior into panning, dragging, selection, cutting, keyboard navigation, scrolling, and pushing-item concerns. State classes make interaction modes explicit rather than embedding all pointer logic in controls.
• Nodify/Editor/NodifyEditor.cs
• Nodify/Editor/NodifyCanvas.cs
• Nodify/Editor/States/EditorState.cs
Input, Gestures, and Navigation
The interactivity layer maps mouse/key gesture definitions to handlers and maintains element-state stacks during gestures such as drags. This is the boundary between WPF input events and editor/control state transitions. Keyboard navigation is separately modeled through focus navigators and navigation layers.
• Nodify/Interactivity/InputProcessor.cs
• Nodify/Interactivity/Gestures/EditorGestures.cs
• Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs
Nodes, Item Containers, and Grouping
Consumer-provided node view models are rendered through node controls and wrapped in ItemContainer instances, which own selection, location, drag state, and preview-location events. Specialized controls support input/output nodes, knots, state-machine nodes, and grouping. The library exposes UI behavior/events; domain graph persistence and semantics remain application-owned.
• Nodify/Containers/ItemContainer.cs
• Nodify/Nodes/Node.cs
• Nodify/Nodes/GroupingNode.cs
Connectors and Connections
Connectors initiate and complete links via a pending-connection workflow; application view models react to connector/connection events to create, remove, or retarget their domain edges. Connection controls render several graph-edge styles and expose states for actions such as split and disconnect. This separates visual interaction from the host’s graph model.
• Nodify/Connectors/Connector.cs
• Nodify/Connectors/PendingConnection.cs
• Nodify/Connections/Connection.cs
Viewport, Selection, and Auxiliary Editing
The editor supports selection, zoom/pan, cutting lines, and minimap navigation. A minimap maintains a reduced viewport/item representation and has its own pan/zoom/navigation states. Movement and resizing surface event arguments so hosts can update bound model positions and execute undo/redo policies.
• Nodify/Minimap/Minimap.cs
• Nodify/CuttingLine/CuttingLine.cs
• Nodify/Editor/Events/ItemsMovedEventArgs.cs
Presentation and Runtime Boundaries
The runtime is WPF/.NET with no stated dependency beyond WPF. Default control templates, dark/light palettes, and styles are delivered as XAML resources; host applications can override them. CI builds, analyzes, releases, publishes the NuGet package, and syncs documentation via GitHub Actions. No backend, database, or external runtime service is represented.
• Nodify/Themes/Generic.xaml
• Nodify/Themes/Styles/NodifyEditor.xaml
• .github/workflows/publish-package.yml
Reference Applications
Examples demonstrate distinct host-owned graph semantics: a configurable editor playground, workflow designer, drawable shapes canvas, executable state machine, and reactive calculator. They are integration references for MVVM bindings, view-model graph ownership, commands, and optional undo/redo—not dependencies of the package.
• Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs
• Examples/Nodify.StateMachine/Runner/StateMachine.cs
• Examples/Nodify.Calculator/OperationGraphViewModel.cs
Main entry points: NodifyEditor.cs NodifyEditor · Nodify.csproj Nodify package · ItemContainer.cs ItemContainer · Node.cs Node controls
Components 22
Nodify WPF Library
Reusable MVVM-oriented node editor controls.
- Nodify package · Public control library distributed as NuGet.
Nodify/Nodify.csproj - NodifyEditor · Hosts graph editing and coordinates editor modes.
Nodify/Editor/NodifyEditor.cs - NodifyCanvas
Nodify/Editor/NodifyCanvas.cs - Editor states · Explicit modes for pan, drag, selection, cutting, and navigation.
Nodify/Editor/States/EditorState.cs - Input processor · Converts input events into control state transitions.
Nodify/Interactivity/InputProcessor.cs - Editor gestures
Nodify/Interactivity/Gestures/EditorGestures.cs - Focus navigation
Nodify/Interactivity/KeyboardNavigation/StatefulFocusNavigator.cs - ItemContainer · Owns selection, position, drag state, and preview events.
Nodify/Containers/ItemContainer.cs - Node controls · Renders consumer-provided node view models.
Nodify/Nodes/Node.cs - GroupingNode
Nodify/Nodes/GroupingNode.cs - Connector · Starts and completes user link interactions.
Nodify/Connectors/Connector.cs - Pending connection
Nodify/Connectors/PendingConnection.cs - Connection controls · Renders graph links and split/disconnect actions.
Nodify/Connections/Connection.cs - Minimap · Maintains reduced item and viewport representation.
Nodify/Minimap/Minimap.cs - CuttingLine
Nodify/CuttingLine/CuttingLine.cs - Items moved events · Lets hosts update positions and apply undo/redo policies.
Nodify/Editor/Events/ItemsMovedEventArgs.cs - Default themes · Templates, palettes, and editor styles overridable by hosts.
Nodify/Themes/Generic.xaml - Editor styles
Nodify/Themes/Styles/NodifyEditor.xaml
Reference Hosts
Applications own graph semantics and persistence.
- Playground view model · Configurable editor integration example.
Examples/Nodify.Playground/Editor/NodifyEditorViewModel.cs - State machine runtime · Executable domain behavior owned by a reference application.
Examples/Nodify.StateMachine/Runner/StateMachine.cs - Calculator graph VM · Reactive calculator integration example.
Examples/Nodify.Calculator/OperationGraphViewModel.cs
Packaging
- Package publishing · Builds, analyzes, releases, and publishes the package.
.github/workflows/publish-package.yml
Connections 21
- Nodify package → NodifyEditor: exports
- NodifyEditor → NodifyCanvas: hosts items on
- NodifyEditor → Editor states: uses
- Input processor → NodifyEditor: drives
- Editor gestures → Input processor: defines bindings for
- Focus navigation → Editor states: participates in
- NodifyCanvas → ItemContainer: contains
- ItemContainer → Node controls: wraps
- GroupingNode → Node controls: specializes
- Node controls → Connector: presents endpoints
- Connector → Pending connection: creates
- Pending connection → Connection controls: completes as
- NodifyEditor → Minimap: shares viewport with
- NodifyEditor → CuttingLine: orchestrates
- ItemContainer → Items moved events: raises
- Default themes → Editor styles: includes
- Editor styles → NodifyEditor: templates
- Playground view model → Nodify package: integrates
- State machine runtime → Nodify package: integrates
- Calculator graph VM → Nodify package: integrates
- Package publishing → Nodify package: builds and publishes