Hi, we are facing an issue with links reshaping below are the steps:
As we draw a link from Node A to Node B that links route (Points) sets automatically.
Now, I am Reshaping or moving it using it’s adornments after reshaping I try to move, any of the connected node from the same link.
As I move any connected node, the link start reshaping from the route which was set automatically (route which was set for the very first time when I’ve drawn that link) rather start reshaping from what I’ve set after link drawn using adornments (step 2).
I’ve checked it into your demo application. it’s happening there too. Do we have some event or technique to save these updated routes what user is setting using adornments.
I do not understand what you want. Some small screenshots/sketches would help.
It sounds as if you do not want the route to be recomputed when a connected node is moved, although perhaps only after the user has manually reshaped the route. If you implemented that, there would be an arbitrarily large gap between the end of the route and the position of the port.
The purpose of Adjusting="End" is to provide that behavior while still maintaining the end points to keep the link in contact with both ports. By your screenshot you really do not want the link end points to touch their ports.
That is a very unusual request. I cannot recall anyone ever asking for that kind of functionality. Maybe you could implement that by setting Adjusting="End" and overriding Route.AdjustPoints to do nothing after the user has reshaped the route. That would also mean overriding LinkReshapingTool.DoReshape to set a flag recording the fact that the route had been reshaped.
I don’t think that feature is achievable now in GoXam. Basically, Routing==AvoidsNodes always takes precedence over Adjusting in computing the route. Sorry.
Hmm, upon further thought, perhaps overriding Route.ModifyEndPoints could do what you want. Basically you could check whether the current route crosses over any nodes – if so, return false, otherwise return true.
Just a thought about the implementation. I draw 2 nodes and the links as shown in the above diagram and I reroute the link as shown in the second image and when I copy the nodes and the links ( using rubberband Zoom) and I paste the copied link isn’t rerouting but the pasted link will get rerouted.
Can I replace the Route points of the pasted link with the ones of the coped links before the paste is happening ?
When exactly does the route gets reset to default ? Is it before the paste event or after the paste event ?
After the paste, the Node and its elements are remeasured and rearranged, as must happen with all FrameworkElements, causing the node to invalidate the routes of connected links. And the elements of those new Links have to be measured and arranged too.
No, that is a fundamental part of the WPF architecture. However there might be a way to reset the route(s) in a Diagram.LayoutCompleted event handler, which is called after everything has settled down. Maybe one could override CommandHandler.CopyToClipboard to remember routes and CommandHandler.PasteFromClipboard to establish a Diagram.LayoutCompleted event handler to restore the routes and also unregister itself.