Link points being recomputed

Our application can have multiple tabs, each with a diagram in them, and we have come across an issue where:

  • a link is reshaped in tab 1
  • the user switches to another tab and then returns to tab 1
  • after the link is re-added to the diagram a call is being made to Route.ComputePoints, which then reverts the links points to its default state

Is there any way I can prevent my routes from being recomputed when switching between diagrams?

Thanks
Ryan

Is the Diagram actually in a System.Windows.Controls.TabControl?

If not, and if switching “tabs” results in the controls in old tab being unloaded, perhaps you need to set Diagram.UnloadingClearsPartManager to false.

The tabs system we are using are from another controls suite…

I tried setting Diagram.UnloadingClearsPartManager to false but that hasn’t fixed the problem. I’m not sure if it’s relevant, but even though UnloadingClearsPartManager is set to false on my Diagram, when ComputePoints is being called in my route the Route.Link.Diagram.UnloadingClearsPartManager is set to true.

The links are being re-added to the diagram correctly when it gets focus in the PartManager, but something after that is causing the routes to be recalculated… any ideas what the cause might be?

I think the basic problem is that the Diagram is being unloaded and then reloaded.
Any change to the size or position of a node will cause all connected links to be re-routed, as one would expect.

There’s no code in GoXam that sets the Diagram.UnloadingClearsPartManager property.
(The default value is true.)
So I would focus on why/how that property is getting set to true again, if it really is the same Diagram.

It turned out something in the overview diagram was causing the route to be recomputed when the tab switched.

Yes, that’s another reason to use different and simpler templates in an Overview, besides the usual performance reasons.

The normal implementation of Overview removes known data-bindings that would cause bad “feedback” that is like what you are seeing. But obviously it can’t know about everything that you have added.