I am using databinding for my docking windows, and I am using the built-in layout serialization to persist the layout.
If I have a tool window open and I serialize the layout, when I next restore the application (deserialize) I can open the window at any time (lazily load) and it will open at the previous location (as expected). This works great.
If I close (destroy) the same tool window and open it again (i.e. a window with the same unique name), then it opens in a default location and state, which is not desired.
If I close (destroy) the tool window, then serialize the layout, when I next restore the applciation (deserialize) then the tool window opens to a default location and state, which again is not desired.
How can I, or what is the appropriate strategy to, persist the layout of closed tool windows both within the same and accross multitple sessions?