Identifying Link Direction

Hi Walter,

Consider I have 2 nodes with ports and a link that connects them at port.node 1 accepts only inwards link (go:Node.LinkableTo=“True” ) and node 2 port accepts only the outward link (go:Node.LinkableFrom=“True” ).

I can manually connects 2 nodes and now based on the start node I have to change the template of the link.
i.e If I connect link from node 1 to node 2 the template should have lets say template 1. If I connect link from Node 2 to Node 1 the template should be Template 2.

In model changed event , we are getting the linkdata but in either of above cases we get from node as Node 2 and to node as Node 1.

What I want to get is that from which node the link has been started so that I can update my template?

I think it is easier to implement a Diagram.LinkDrawn event handler (and maybe also a Diagram.LinkRelinked event handler, if your app supports that) to look at the e.Part (which is the new Link), look at its Link.FromNode, and decide how to change the link’s template by setting the Category property on the link data object in the model. The documentation of the Part.Category says that it is effectively read-only, but that you can change the template by changing the category of the link data object: GoXam for WPF 2.2.4