I’m trying to modify my Diagram model from code behind.
What I’m trying to do is to remove the link between the LabelNode 22 and the other LabelNode on the cold stream. So the Diagram should be simular to the picture below
So, if we only focused on the hot stream, here is what I’m doing:
- Remove 22
- Remove 2
- Remove 3
- Remove link from 1 to 2
- Remove link from 3 to 4
- Create a new LabelNode
And here is the code for updating the model after removing items:
streamLink = New GoXam.StreamLink(stream)
streamLink.LabelNode = exchangerConnector.GUID
_GridDiagramModel.AddOrUpdateLink(streamLink)
_GridDiagramModel.SetLinkFromPort(streamLink, stream.FromConnector, "")
_GridDiagramModel.SetLinkToPort(streamLink, stream.ToConnector, "")
_GridDiagramModel.AddOrUpdateNode(New GoXam.ExchangerNode(exchangerConnector))
_GridDiagramModel.SetLinkLabelKey(streamLink, exchangerConnector.GUID)
And here is what I obtained for the Hot Stream
I tried to see what was the result of these methods (FindLabelNodeKeyFor, FindFromNodeKeyForLink, FindToNodeKeyForLink) and everything seems to be OK…
Any idea???