Divelements Community
Customer discussion of all Divelements products

TabbedDocument Layout Not Restoring

Latest post 01-17-2008 10:30 by Howard. 3 replies.
  • 12-20-2007 15:07

    • Howard
    • Not Ranked
    • Joined on 12-20-2007
    • Posts 2

    Hmm [^o)] TabbedDocument Layout Not Restoring

    Hi

    Having read several posts here on the subject I'm now tearing my hair out on this.

    First off, using 3.0.0.1

    I'm using SandDockManager.GetLayout() and .SetLayout(). The SerializeTabbedDocuments property is set to true.

    I'm instantiating TabbedDocuments and assigning each one a Guid.NewGuid and setting the PersistLayout property to true.

    The resultant serialization xml appears to be correct as far as I can tell (see attached - i have 4 dock windows of which 2 hidden and 4 tabbed documents).

    However, when I restore the layout by calling SandDockManager.SetLayout(), the dock controls are restored correctly but the documents are not.

    Does anyone know what I'm doing wrong here, this is driving me nuts.

    Aside from this, SandDock is by far the best control* I've ever used and I've used a LOT.

    * - documentation is meh tho!
  • 01-02-2008 22:56 In reply to

    Re: TabbedDocument Layout Not Restoring

    Try assigning fixed guids (not using .NewGuid which generates a new 'random' guid) to your documents.
    Then make sure the documents exist (are created) when you restart your app, and then restore the layout.

    Yves
  • 01-05-2008 9:39 In reply to

    Re: TabbedDocument Layout Not Restoring

    deathangel is correct: assigning random Guids to your windows on startup won't help at all. The point of the Guid property is that it uniquely identifies windows. So it needs to be the same from one run of the application to the next.
  • 01-17-2008 10:30 In reply to

    • Howard
    • Not Ranked
    • Joined on 12-20-2007
    • Posts 2

    Re: TabbedDocument Layout Not Restoring

    Sorry, thought I responded. Got it all working rather brilliantly now subclassing both the Manager and TabbedDocument classes to provide document layout persistence and closing in response to business objects being deleted etc.

    Never any misunderstanding about Guids, I just didn't quite grasp that the TabbedDocuments had to be manually recreated before calling SetLayout().

    For some reason I thought that SetLayout would reinstantiate the TabbedDocuments on its own and that I should then enumerate them and correlate against my own persistence data to recreate their contents/titles.

    Documentation not very clear!
Page 1 of 1 (4 items) | RSS
Copyright © 2008 Divelements Limited
Powered by Community Server (Commercial Edition), by Telligent Systems