Hi,
we have a problem with links routing after reloading nodes and links in the diagram.
We do not reload the whole Diagram - we just clear nodes and links in Diagrams model, and than - we add nodes and links, previously saved. Reloading takes place in a transaction. After transaction commit, link routes are resetting. I know, that there were already posted some issues to this problem. But I couldn’t get this to work.
Here is the code that reloads all nodes and links:
_model.Model.StartTransaction("initial");
if (_model.Nodes.Any() && _model.Links.Any())
{
_model.Nodes.Clear();
_model.Links.Clear();
}
foreach (var node in nodes)
{
var model = new NodeViewModel(node);
_model.Nodes.Add(model);
}
foreach (var link in links)
{
var model = new LinkViewModel(link);
_model.Links.Add(model);
}
_model.Model.CommitTransaction("initial");
In LinkViewModel constructor, which inherits: GraphLinksModelLinkData<string, string>, I write it’s Points value.
A have also tried to write Link.Route values in PartManagers’ overrided OnModelChange from my LinkViewModel - but it still did not work.