Posted 16 years ago
by dmelinosky
Hi there,
I set up my DockSite in my main window like thisThen i programmatically add document windows like this:
This all works great until I close the last window. When I close the last window, it seems the Mdi containers also close and if i try to add another window, I get an exception saying:
DockSite must contain at least one MdiRootContainer element to open a new DocumentWindow.
Is there anyway to prevent this behavior? If not, where should I start looking to catch an event to recreate a MdiRootContainer?
I set up my DockSite in my main window like this
<!-- DockSite, the contents of the window are used of dockable Toolwindows and Documents -->
<docking:DockSite x:Name ="dockSite" regions:RegionManager.RegionName="DockRegion">
<docking:SplitContainer>
<docking:Workspace>
<docking:TabbedMdiHost x:Name="tabbedMdiHost">
<docking:TabbedMdiContainer>
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:SplitContainer>
</docking:DockSite>
</DockPanel>
DocumentWindow window = new DocumentWindow(this.WrappedSite, windowName, windowTitle, imageSource, view);
window.Activate();
DockSite must contain at least one MdiRootContainer element to open a new DocumentWindow.
Is there anyway to prevent this behavior? If not, where should I start looking to catch an event to recreate a MdiRootContainer?