I see a similar question has been asked on this forum before, but when I try to run the attached sample code it crashes, and the thread does not provide a real solution, so here goes...
What I want to do is the following:In XAML, create the XamDockManager and 3 SplitPanes (left, right and bottom).Each SplitPane should have a TabGroupPane, the TabGroupPanes are my region hosts.Initially, there are no ContentPanes in any of the TabGroupPanes. We need to add and remove them dynamically.This is what I would like my markup to look like;
<ig:XamDockManager x:Name="dockManager"> <ig:XamDockManager.Panes> <ig:SplitPane Location="Left"> <ig:TabGroupPane x:Name="tabGroupPaneLeftRegion" prism:RegionManager.RegionName="LeftRegion"> </ig:TabGroupPane> </ig:SplitPane> <ig:SplitPane Location="Right"> <ig:TabGroupPane x:Name="tabGroupPaneRightRegion" prism:RegionManager.RegionName="RightRegion"> </ig:TabGroupPane> </ig:SplitPane> <ig:SplitPane Location="Bottom"> <ig:TabGroupPane x:Name="tabGroupPaneBottom" prism:RegionManager.RegionName="BottomRegion"> </ig:TabGroupPane> </ig:SplitPane> </ig:XamDockManager.Panes> <ig:DocumentContentHost x:Name="docHost"> <ig:DocumentContentHost.Panes> <ig:TabGroupPane x:Name="docsTab" prism:RegionManager.RegionName="ContentRegion"> </ig:TabGroupPane> </ig:DocumentContentHost.Panes> </ig:DocumentContentHost> </ig:XamDockManager>
I've created a region adapter for the TabGroupPane that adds or removes ContentPanes when the Views collection of a region changes. However, when I add a ContentPane nothing appears.What I have to do to make my ContentPane appear, is initially have a XamDockManager with no split panes and tab group panes, and then add Split and TabGroupPanes dynamically when an item in my region Views collection wants to be put in a specific region.
The problem is that if I add two (or more) ContentPanes to a TabGroupPane, and then removes / closes all but one, the XamDockManager decides to remove the entire TabGroupPane and move the remaining ContentPane to the Panes collection of the SplitPane...and since the TagGroupPane is the region host, I loose my region host...so the next time I want to put something in my region host it's not there.
So my question is, how do I make this work?
-Thanks
Ok, thanks
Should I make a feature request about this? I guess it won't make it into the 11.2-release anyway? We're not releasing until mid 2012, so we can live with the modifications we've made to the source during development if we can get a good indication from you that this "issue" will be fixed or we will in some way be able to override the behavior in a release before mid 2012.
What you could do is raise a event with a cancellation token when doing this cleanup so we can prevent this from happening. If you pass along the pane you're removing we can examine it to see if a region manager is attached. After all, Prism is much used and it's pretty hard to use the XamDockManager with Prism with this behavior.
Hi,
Just wanted to let you know that i haven't forgotten about you.
However, i don't currently have a suggestion. The way the xamDockManager works, is it removes container panes when it no longer needs them. If there is only one pane left in a containerPane, it removes the parent, so as not to keep nesting pane upon pane, upon pane. The only way a parent pane would return is if you re-docked a pane whose previous parent was that removed parent pane.
-SteveZ
The formatting of the last part got messed up, so I'll try again...
I've created a region adapter for the TabGroupPane that adds or removes ContentPanes when the Views collection of a region changes. However, when I add a ContentPane nothing appears.
What I have to do to make my ContentPane appear, is initially have a XamDockManager with no split panes and tab group panes, and then add Split and TabGroupPanes dynamically when an item in my region Views collection wants to be put in a specific region.The problem is that if I add two (or more) ContentPanes to a TabGroupPane, and then removes / closes all but one, the XamDockManager decides to remove the entire TabGroupPane and move the remaining ContentPane to the Panes collection of the SplitPane...and since the TagGroupPane is the region host, I loose my region host...so the next time I want to put something in my region host it's not there.