Closed elgransan closed 1 year ago
Hello,
You can create a custom class and inherit from PortModel
, then override CanAttachTo
to include whatever logic you need.
In your case, a simple bool
property IsSource
for example can do the job, then the new method could look something like:
public override bool CanAttachTo(PortModel port)
=> base.CanAttachTo(port) && IsSource != port.IsSource;
Hi thanks it's working perfect using aligments in this way
public override bool CanAttachTo(PortModel port) => Alignment == PortAlignment.Bottom && port.Alignment == PortAlignment.Top;
But I had to remove base method call because I couldn't connect itself, It's the correct way to allow connecting itself?
Thanks!
Perfect thanks a lot!
Hi, it is possible to set a port as only source and other as only target?