$ show miroiu/nodify
Nodify is a production-grade WPF library for building node-based graph editors. It provides a comprehensive set of custom controls (NodifyEditor, ItemContainer, Connector, various connection types, Minimap, GroupingNode, StateNode, etc.) along with a sophisticated input processing system based on composable state machines. The library is designed for MVVM, exposes rich command and event hooks, and supports full theming with dark/light/Nodify themes. The codebase demonstrates high craftsmanship in its input state machine pattern (InputProcessor/InputElementStateStack), undo/redo framework (ActionsHistory), gesture customization system (EditorGestures), and performance optimizations (BoxValue, connector safe-zone hit-testing). It ships with five example applications (Calculator, Playground, Shapes, StateMachine, Workflow) that showcase real-world usage patterns including sub-workflows, real-time collaboration simulation, and undo/redo. The library targets a wide range of .NET frameworks from .NET Framework 4.7.2 through .NET 10 preview, with CI builds and NuGet publishing pipelines. Despite a large API surface and some mutable global settings, the code is well-organized, extensively documented, and actively maintained.
The LLM identified 4 files worth highlighting for reuse:
A full undo/redo system with batch support, pause/resume, and a stack-based history. Implements IAction with DelegateAction for arbitrary reversible operations. Supports batching via a disposable Batch() method and a Global static instance. The design is clean, thread-safe for single-threaded UI, and easily extractable as a standalone undo/redo library.
Static class providing pre-allocated boxed values for common types (double, bool, Thickness, etc.) to avoid boxing allocations in WPF dependency property callbacks. Each value is lazily initialized and cached. This pattern is directly reusable in any WPF project to reduce GC pressure from repeated boxing of constant values.
Lightweight base class implementing INotifyPropertyChanged with a SetProperty<T> helper and a PropertyChanged event. Supports property dependencies via a dictionary of dependent property names. No external dependencies beyond System.ComponentModel. Can be reused as a minimal MVVM base across any .NET project.
Simple IAction implementation that stores delegates for undo and redo actions. Allows creating reversible operations inline without subclassing. The pattern is general-purpose and can be extracted as a building block for undo/redo systems in any application.