Closed Zapwasd closed 1 year ago
I have found the solution to my problem.
diagram.SelectionChanged += Diagram_SelectionChanged;
private void Diagram_SelectionChanged(SelectableModel element) { int selectedLinksCount = diagram.Links.Count(x => x.Selected); int selectedNodesCount = diagram.Nodes.Count(x => x.Selected); int selectedGroupsCount = diagram.Groups.Count(x => x.Selected);
if (selectedLinksCount == 1 && selectedNodesCount + selectedGroupsCount == 0)
{
diagram.Options.DeleteKey = "Delete";
}
else
{
diagram.Options.DeleteKey = "";
}
}
Hello,
Did you try using Options.Constraints
? There is ShouldDeleteNode
option, which returns true by default, you can change it to _ => false;
Hello,
Did you try using
Options.Constraints
? There isShouldDeleteNode
option, which returns true by default, you can change it to_ => false;
Thank you zHaytam for your suggestion. It works fine.
I would like to have the possibility to delete links but disable the possibility to delete nodes. Nodes should mantain the possibility to be moved. Is it possible?
Thanks in advance.