Hello,
I am working on a project based application, like visual studio, that requires the pane to be completely removed from working memory to avoid "Out of Memory" errors.
The problem is that the PaneViewModel stores the content (in my case a UserControl), as intended, but when that PaneViewModel instance is removed from the MainWindowViewModel.Panes Collection, the memory (in diagnostic tools) shows it is not being reclaimed.
My assumption is that GC is not collecting the removed PaneViewModel because some how the UserControl or Pane is still referenced somewhere by the DocumentHost or RadDocking.
I've attached a modified version of the VisualStudioDocking example project that recreates/demonstrates the behavior I've described above. During runtime, please add new documents and close them at least 10 times to notice how big the difference is in memory over time.
Regards,
Patrick
base.RemovePane(pane);
Does not reclaim all the memory, but some is better than none, hope this helps whoever can figure out the solution.protected override void RemovePane(RadPane pane) { base.RemovePane(pane); pane.Header = null; pane.DataContext = null; pane.Content = null; pane.ClearValue(RadDocking.SerializationTagProperty); pane.RemoveFromParent(); GC.Collect(); }