Remove Links Dinamically

Hi, i need remove a Link dinamically.

I know both nodes and the link.



Mi model is :



var model = new GraphLinksModel<Item, String, String, GraphLinksModelLinkData<String, String>>();



model.NodeSource = new ObservableCollection(){



};

myDiagram.Model = model;





Can somebody help me?

Thanks!

If you have the link data object, you can remove it from the model by calling GraphLinksModel.RemoveLink.

Or you can just remove it from the GraphLinksModel.LinksSource collection, assuming it’s an ObservableCollection.

If you don’t have the link data object, but you do have the Link element in the Diagram, you can get the link data via Link.Data.

In the special case where the Link is the only selected part, you can call CommandHandler.Delete().

Hi Walter,



I modified my LinkSource to

model.LinksSource = new ObservableCollection<GraphLinksModelLinkData<String, String>>();



and it worked!



I really appreciate your help.