Is there a way to attempt to load layout from xml but make it fail if the xml specifies panes or controls that don't exist on your form or when there are controls that are docked in your form that aren't specified in the xml.
The situation I'm in is that I did some development, saved my layout, added a new control and docked it. Then at runtime when I load from xml it is quite happy to accept the old saved layout and the initially docked control is left undocked in the middle of my form. I want it to throw an exception if any previously docked controls are left undocked as the result of a load.
It sounds like the best thing to do here would be to build a list of docked controls before loading your layout, then verify they are all still docked after loading the layout. To build the list, you can iterate over the ControlPanes collection of the dock manager. For each DockableControlPane, store its Control in a collection. After loading the layout, iterate the ControlPanes collection again, this time removing each pane's Control from the collection. If your collection has any items left over, they were not all loaded back into the dock manager.