GoXam diagram disappears unexpectedly

We have a window which can be made full screen and inside we have tabbed windows like in browser and in one of our tabs we have a dock pane and inside that we have the goxam diagram.

When the user clicks the full screen button, the current active tab becomes full screen. (during this time the cotainer control template is also changed). And similarly the user can toggle back to normal mode.
During switching back the goxam control disappears and there is nothing in the dock pane.
Inspecting with Snoop, we still see the Diagram bounds, but there is nothing. Is there any clue why this might happen?

We use goxam control in three of our tabs and we face this issue everywhere.
(NB, we dont have the source code of the window and docking framework, since we develop tabs like somekind of plugins. But we dont see this issue for any of our controls or any third partly controls)

Well, the default behavior is that the Diagram has an Unloaded event handler that causes all of the modeled Parts to be removed, in order to free up memory and avoid memory leaks in WPF and Silverlight. And apparently the default behavior in implementations of tabbed page controls is to unload the controls that occupy the pages that are not in the “current” page.

This can be avoided by setting Diagram.UnloadingClearsPartManager to false.

However, to try to do the right thing for people automatically, if the Diagram detects that it is inside a WPF/Silverlight toolkit TabControl, then it assumes that it should not do this clearing when the Diagram is unloaded. This is obviously faster for people when switching tabs back and forth, and more importantly can keep some state that isn’t being saved in the model data.

But if you are not using the framework’s TabControl, then the Diagram cannot know about that, so you will want to set Diagram.UnloadingClearsPartManager to false yourself.

Thanks a lot, it works like a charm…
Is there something to be done to make sure everything is released when we close the tab containing the diagram is closed. (TAB is custom implementation, not WPF tab)

If I were you I would first make sure there really is a memory leak before considering doing anything special.

If there is a memory leak (which would be due to references to FrameworkElements from Bindings), then you could try setting Diagram.UnloadingClearsPartManager back to true before removing the Tab containing the Diagram.