NodeNetwork icon indicating copy to clipboard operation
NodeNetwork copied to clipboard

Is there any way to keep the nodes connected and not disconnect when dragging?

Open Ptkatz opened this issue 1 year ago • 2 comments

I don't want the connected nodes to disconnect,I used this method, but it still disconnects when dragging the port.

node2Input.Port.ConnectionDragStarted.Subscribe(s =>
{ node2Input.Port.OnPortEnter(); });

Ptkatz avatar Apr 01 '23 18:04 Ptkatz

You can derive from NodeInputViewModel and overwrite the CreatePendingConnection() and do something like

if (MaxConnections == 1 && Connections.Items.Any())
    return;
base.CreatePendingConnection();

FabianNitsche avatar Apr 04 '23 12:04 FabianNitsche

You can derive from NodeInputViewModel and overwrite the CreatePendingConnection() and do something like

if (MaxConnections == 1 && Connections.Items.Any())
    return;
base.CreatePendingConnection();

ok, thank you very much.

I have another question, how to make the connecting line of two nodes have an arrow.

Ptkatz avatar Apr 04 '23 17:04 Ptkatz