I've been trying to make my code dynamically create a port when I move a connection to its side, currently my code is working perfectly except I know no way to delete the unused ports that I create from the nodes.
I am using the ConnectorSourceChangedEvent and ConnectorTargetChangedEvent handlers and when I remove the Ports inside the handler I get
"An unhandled exception of type 'System.NullReferenceException' occurred in Syncfusion.SfDiagram.Wpf.dll"
and a
"An unhandled exception of type 'System.InvalidOperationException' occurred in System.Core.dll
Additional information: Sequence contains no elements"
if I also set the connector.SourcePort as null.
Am I doing something wrong here?