Hi,
I am wondering how I could remove a ContentPane (to which I have a reference) from a dockManager.
I am using
IEnumerable<ContentPane> enumerator = dockManager.GetPanes(PaneNavigationOrder.ActivationOrder);
Using the enumerator I am identifying the ContentPane which meets a certain condition.
How could I programmatically remove the ContentPane?
Thanks,
Cristian
Hello Christina,
Does the Remove|RemoveAt() methods of the Panes collection not work in your scenario?
Hi Alex,
Are you refering to xamDockmanager.Panes.Remove/RemoveAt?
Remove/RemoveAt accept SplitPanes not ContentPanes (that is what the documentation says)
Regards,
Christian,
Actually no, but you are right. The Panes collection of the XamDockmanager acceps only SplitPanes, but each splitpane has also Panes collection, which contains ContentPanes.
What you can do is, when you know which ContentPane you want to remove, you can get its Parent, which will be another pane like a SplitPane and delete it from that SplitPane Panes collection.
Thank you Alex,
I will do that.
Best regards,
Actually the parent could also be the unpinned tab area. The best way to remove a contentpane is to set its CloseAction to RemovePane and use the Close command. e.g.
One small addition.
The Parent could also be a TabGroupPane in which case the removal would be done from its Items collection