Hi,
I had problems with closing all windows before reloading layout. It turned out that the DockContentCollection was not cleared well. To prevent problems I added a RemoveAll method and improved the existing RemoveContent method.
//veg: 22-12-2008 - Added method to remove all IDockingContent.
// Call before reloading layout.!
//veg: 01-20-2009 - Reordered code to prevent problems with DockState.
public void RemoveAll()
{
for (int i = Count; i != 0; i--)
{
RemoveContent(this[i - 1]);
}
}
//veg: 22-12-2008 - Added Public version of Remove() with some additional cleanup!
public void RemoveContent(IDockContent content)
{
if (content == null)
throw new InvalidOperationException();
Remove(content);
((DockContent)content).DockState = DockState.Unknown;
((DockContent)content).FloatPane = null;
((DockContent)content).DockPanel = null;
((DockContent)content).Pane = null;
}