AvalonDock SaveLayout?? RestoreLayout??

Oct 20, 2009 at 10:09 AM

can anybody help me please?

i would like to save my docking layout on my application close even and restore it on load up. i have been trying to use the savelayout property with no result.

could i please have an example on how to do this?

Oct 31, 2009 at 11:35 PM

dockingManager1.SaveLayout(LayoutFile.FullName);

---

if (LayoutFile.Exists)
            {
                try
                {
                    dockingManager1.RestoreLayout(LayoutFile.FullName);
                }
                catch (Exception)
                {
                    // There's a problem with the save file, delete it.
                    LayoutFile.Delete();
                }
            }

 

I comment out in file: DockingManager.cs these two lines, and it works fine.

void RestoreLayout(XmlDocument doc)
        {
            //if (!_isControlLoaded)
            //    throw new InvalidOperationException("Unable to deserialize a docking layout while DockingManager control is unloaded");

            if (doc.DocumentElement == null ||
                doc.DocumentElement.Name != "DockingManager")

etc...

Mar 3, 2010 at 5:49 PM

I tried this but i still have an issue when i dock panels inside another panels (Not resizing panels only).

 

I receive the an InvalidOperationException ("The enumerator is not valid because the collection changed.") in the form's show method.

 

Any ideas?

 

Thanks!

Fede