Hello,
I want to close the Panes, and not just Hide them (put them in the ClosedPanes collection).
There is no CloseAction property on Pane, so how can i accomplish that?
I want to release the memory as the dynamically created documents/toolwindows are closed.
Thank you in advance,
Michael
Konstantin,
We have the same problem with disposing the ContentPane. I took your example from above and after making a few small modifications. I was able to remove most of the references from the ContentPane but as shown from the Memory profiler below, TabPaneHeader is not allowing the ContentPane to be released. I also included the code below, This is causing a major memory leak in our application. I would really appraciate your help.
Regards
private void xamDockManager_PaneClosing(object sender, CancellablePaneEventArgs e) { e.Cancel = true; ContentPane cPane = e.Pane as ContentPane; UIElement fContent = (UIElement)(cPane).Content; //If content is Plan Details call closeform for cleanup if (fContent.GetType().Equals(typeof(PlanDetails))) ((PlanDetails)fContent).CloseForm();
//If content is Pivot Container call closeform for cleanup if (fContent.GetType().Equals(typeof(PivotContainer))) ((PivotContainer)fContent).CloseForm();
cPane.Content = null; xamDockManager.ActivePane = null;
if (e.Pane.IsFloating == true) e.Pane.IsFloating = false; if (cPane != null && cPane.IsPinned == false) { cPane.IsPinned = true; } if (this.xamDockManager.Panes.Contains(e.Pane)) { this.xamDockManager.Panes.Remove(e.Pane); return; } else if (e.Pane.OwnerPane is TabGroupPane) { (e.Pane.OwnerPane as TabGroupPane).Panes.Remove(e.Pane as ContentPane);
(e.Pane.OwnerPane as TabGroupPane).SelectedPane = null;
} else if (e.Pane.OwnerPane is SplitPane) (e.Pane.OwnerPane as SplitPane).Panes.Remove(e.Pane); }
You could use the ClosePane() method of PaneBase object...
Regards,
The pane closing event handler is fired only when the user clicks the "X" button of the pane right?
How can we close the pane programmatically which will cause this event to be fired? Removing from the panes collection does not cause this event to be fired.
Thanks,
i will be monitoring for a suggestion for the recycling behavior...
Hi MIchael,
sorry for the late response,
I have managed to reproduce the issue you've described and I logged a development issue about the panes that become floating when PaneClosing event is canceled, the bug id is #80435. The mem. leak issue id is 80351. I've asked Valerie to associate these bus with your support case so you can be notified when they are resolved.
I'll contact our dev team to see if there is a way to clear a pane's history(this is why after recycling the pane it is situated at its previous place) and go with the panes recycling workaround.