Restoring tool windows from xml

Docking/MDI for Windows Forms Forum

Posted 19 years ago by Rene Bechmann
Avatar
Hi

I have a problem with restoring the tool window positions from a previously saved XML string.

// This is how i save the XML
string xml = dockManager.ToolWindowLayoutData.OuterXml;
SaveDockManagerXML( xml );

// This is how i restore the XML
string xml = ReadDockManagerXML();
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml( xml );
dockManager.ToolWindowLayoutData = xmlDoc;
The effect is that all the tool windows are placed in the upper left corner ( above the menu and toolbar )

The menu and toolbar is from DevComponents XtraBars and does implement docking aswell like moving the menu, toolbar and statusbar around the edges.

When used together UIStudio and XtraBars works like a charm but UIStudio is simply unable to restore propperly. My guess is that it gets confused about where its available working area is (bacause its part of a docking scenario itself)

Does anybody know of the problem? Is there any workaround?

Kind regards

René Bechmann
RBC Data

Comments (3)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rene,

I'm not sure what would cause that... the dock controls should restore correctly, even when used with third party toolbar systems. I'll send you an email and maybe you can send me a test project to look at.


Actipro Software Support

Posted 19 years ago by Rene Bechmann
Avatar
I havent been able to reproduce the problem in a separate test program but in my real application I get an "Object reference not set to an instance of an object." exception when setting the ToolWindowLayoutData property.
try
{
    dockManager.ToolWindowLayoutData = xmlDoc;
}
catch( System.Exception ex )
{
    SystemInformation.Debug.WriteException( ex );
}
This is why my tool windows are left in such a mess ;o)

I will investigate further...

P.S. Is there any way to avoid all that flickering when the tool windows rearrange?
Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We suspend the layout of the controls while they rearrange to minimize any sort of redrawing as much as possible.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.