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
745
XamDockManager and Prism fails
posted

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