Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Removing programmatically a ContentPane from UnpinnedTabArea
posted

Hello,

We use a xamDockManager in our project which contains several SplitPanes and ContentPanes inside them. 

This panes can ba added/removed dynamically based on users actions. 

Everything is working fine except in this case : 

We have a ContentPane in a SplitPane. The ContentPane is docked. Then we unpin it. So, the parent of the ContentPane is now an UnpinnedTabArea. 

And we would like to remove it from the UnpinnedTabArea, in code. 

This is how it looks : (pane is the ContentPane)

if (pane.Parent != null && (pane.Parent is SplitPane || pane.Parent is UnpinnedTabArea))
{
   

    if (pane.Parent is SplitPane)
        ((SplitPane)pane.Parent).Panes.Remove(pane);

    if (pane.Parent is UnpinnedTabArea)
    {

    }

}

The first instruction (pane.Parent is SplitPane) is working fine (the pane.Parent property is set to null after the remove instruction and we can add it anywhere we want). 

For the second instruction (pane.Parent is UnpinnedTabArea), we try different options but it's always impossible to access and modify the items collection of the unpinnedtabarea. 

Thank you in advance for your answers,

JC