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
Hello JC,
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well.
Thanks again.
Yes, it works perfectly !
Big thanks :)
I have modified the sample you have sent me, so now it works as you want. Basically I used the TogglePinnedState command in order to change the parent of the unpinned ContentPane to SplitPane. Also I used a Dispatcher in order to delay the serialization, otherwise the ContentPane’s Parent wasn’t reset to SplitPane. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Hello Stefan,
Here is a sample project.
You have two panes and the goal is to be able to reset their positions after making them go anywhere.
It works fine except when you unpin the panes.
Note that we can't use the loadlayout/savelayout method because we need to add our panes dynamically by code.
Thank you,
It seems like that I am missing something in your scenario, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.