I need the user to be able to move currently selected nodes via keyboard arrow keys but I don’t know how. None of the similar questions target GoXam with WPF and I couldn’t adapt the code in the answers. I tried attaching a KeyDown command handler to the Diagram, to the Nodes and I’ve overridden the DoKeyDown in the CommandHandler but nothing even gets called.
So, how can I get the keyboard’s arrow keys to move the nodes?
I’ve just realized it does get hit when I press some character keys, an F1-12 button or the ctrl key, perhaps others as well. But it does not get hit when pressing an arrow key. As the diagram scrolls upon pressing the arrow keys is it possible there’s a default KeyDown handler suppressing my added one, which I have to remove first?
There is another problem: I have a custom DraggingTool with an overridden MoveParts method, which calculates the length of a link and displays the result in a textbox of that link.
However, the MoveParts method does not get called upon moving the nodes using Node.Move(...). Is there a way to move the nodes via the dragging tool or do I have to recalculate the links’ length in the key down event handler?
I would think that you would want to update that textbox on the link whenever the link’s route is recalculated.
You might be able to do that in a binding of Link.Route.Points – I haven’t tried that.
But you can certainly override Route.ComputePoints. Call the base method and if it returns true, modify the TextBlock label with whatever string you like.