Just thought I'd pass on the following info as well. The following code will throw the ActiveContent exception mentioned above.
ClientBrowserFrm browserFrm = new ClientBrowserFrm(); // ClientBrowserFrm is derived from DockContent
browserFrm.MdiParent = this; // commenting out this line will fix the error
browserFrm.Show(dockPanel);
I just ran into this as I used to run the 1.0 version of DockPanel, but as of 2.2 the ActiveContent exception will be thrown if you set the DockContent's MdiParent property
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's still possibly to get this exception when disconnecting DockContent from DockPanel even in DockSample.
It happens when there is no active window in DockPanel (situation can be reached by closing the active window and next window that becomes active). The exception is thrown when the already hided "next window that becomes active" DockPanel property is set to null.
DockSample example:
->Layout By Code
->Close all document windows
->Click Properties windows so that it gets the focus
->Close DockSample (saving layout)
->Start DockSample again
->Close(Hide) Properties window
->Close(Hide) the active window (Solution Explorer)
->Layout By XML
->Unhandled exception (DockPane, line 166)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found another way to raise this exception with latest SVN sources (2007-05-28).
With DockSample example:
1- Do a "Layout by code".
2- Close all documents and panels but "Properties" and "Solution Explorer" (which are grouped on right side).
3- Click on "Properties" panel's "Auto Hide" button.
=> System.InvalidOperationException: Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.
at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent value)
in DockPane.cs:line 162
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I try to disconnect DockContent from DockPanel :
dockContentSample.DockPanel = null;
But i get this exception:
Invalid Content: ActiveContent must be one of the visible
contents, or null if there is no visible content.
I'm looking for a way to load a new layout with new and one
old dockContent without dispose and reacreate the old one.
Thanks
Diego
This is a bug and has been fixed in the SVN.
Just thought I'd pass on the following info as well. The following code will throw the ActiveContent exception mentioned above.
ClientBrowserFrm browserFrm = new ClientBrowserFrm(); // ClientBrowserFrm is derived from DockContent
browserFrm.MdiParent = this; // commenting out this line will fix the error
browserFrm.Show(dockPanel);
I just ran into this as I used to run the 1.0 version of DockPanel, but as of 2.2 the ActiveContent exception will be thrown if you set the DockContent's MdiParent property
It's only partly fixed!
It's still possibly to get this exception when disconnecting DockContent from DockPanel even in DockSample.
It happens when there is no active window in DockPanel (situation can be reached by closing the active window and next window that becomes active). The exception is thrown when the already hided "next window that becomes active" DockPanel property is set to null.
DockSample example:
->Layout By Code
->Close all document windows
->Click Properties windows so that it gets the focus
->Close DockSample (saving layout)
->Start DockSample again
->Close(Hide) Properties window
->Close(Hide) the active window (Solution Explorer)
->Layout By XML
->Unhandled exception (DockPane, line 166)
Fixed again.
Thanks!
I would like to know if is planned a release of the binary with this fix..and when.
Otherwise i will donwload the svn version.
Diego
I found another way to raise this exception with latest SVN sources (2007-05-28).
With DockSample example:
1- Do a "Layout by code".
2- Close all documents and panels but "Properties" and "Solution Explorer" (which are grouped on right side).
3- Click on "Properties" panel's "Auto Hide" button.
=> System.InvalidOperationException: Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.
at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent value)
in DockPane.cs:line 162
The same here!
Fixed.