Get Link info from Diagram Modified

Hi,

I have a event handler attached to GoXamModel.Changed and in ModelChange.AddedLink I want to get the corresponding Link object. The parameter i.e ModelChangedEventArgs of the event would give me the LinkData and from this LinkData I want to extract the corresponding Link.

I tried the following but could not get it.

  1. PartManager but the fromNode and ToNode information are incorrect as it says TemporaryFromNode and TemporaryToNode similarly for Ports
  2. Tried to get it from Model.LinksSource but it returns LinkData not Link.

Could you suggest something about this ?
Thanks

When the ModelChangedEventArgs.Change is ModelChange.AddedLink, the ModelChangedEventArgs.Data is the link data that was added to the GraphLinksModel.LinksSource.

You have to call GraphLinksModel.FindFromNodeForLink or GraphLinksModel.FindToNodeForLink on that link data object to get the connected node data object.

There was a small correction in the question. It wasn’t NodeData rather linkdata.
Sorry for the mistake