[Question] Stacking nodes
We are currently exploring the possibility to implement a node based graph system in one of our editors, while nodify seems to be the most promising tool for us.
Our node based system will work a little bit different so maybe someone can lead us in the right direction and if it is possible with nodify and without too much customization to get it done.
In our graph editor the user should be able of modifying an "workflow" with multiple "steps" in it. Each step may have one ore multiple different "behaviors" attached to it. The user should be able to create a "stack" of behaviors for each step, like seen here. Our first idea was to solve it with a kind of group but the behaviors will define the number of input/output connectors to this stack. Normally we have a one-to-one-relationship, but there are some behaviors (like a multiple-choice-question), where the number of output connectors can increase to up to 4 or 6.
So the question is, if this kind of special "Stack"-Node is possible in nodify without too much rework of the underlying systems?
Thanks in advance!
If you want to support drag-and-drop stacking with the kind of “fancy drop effect” shown in your example, that’s not straightforward. When you drag a node, the ItemContainer captures the mouse, which means you can’t rely on a simple mouse over event to detect when it’s hovering over a potential stack. Nodify also doesn’t provide a built-in event for detecting node intersections.
That said, you could implement this yourself by replacing the default drag interaction for the ItemContainer with a custom one. You could, for example, set attached dependency properties (similar to how PendingConnection uses IsOverElementProperty) and perform hit testing on the editor or manually check for intersections between nodes.
Note: Not capturing the mouse would make auto-panning stop working.
Alternatively, you can also use WPF's built-in drag-and-drop API to drag items from a toolbox directly into the editor, or into a nodes stack.
If, on the other hand, your requirement is simply to let users build a stack of nodes/behaviors in some other way (e.g. through a context menu), that’s much easier to achieve and works with Nodify as-is.