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

Parents
  • 138253
    Offline posted

    Hello JC,

    Thank you for your post. I have been looking into it and I can suggest you call the ExecuteCommand method of the ContentPane with ContentPaneCommads.Close as a parameter like this:

    pane.ExecuteCommand(ContentPaneCommands.Close);
    
     

    This way the code will work in both ways, when the Parent is SplitPane and UnpinnedTabArea. Please let me know if this helps you or you need further assistance on this matter.

    Looking forward for your reply.

Reply Children