We have a complicated application that uses view models to back DocumentWindows. One of our requirements is the application persists tabs that were open, as well as layouts nested within each tab (mostly ToolWindows). However, not all DocumentWindow tabs should persist, and not all ToolWindows should persist, as defined by their respective view models.
There's the crux of the matter - I haven't yet found a way to achieve "selective" layout persistence through the DockSiteLayoutSerializer class or the event handlers it provides access to. All of the events I can access seem to be post-serialization (or deserialization), not hooks that can stop or block serialization for the given window.
Does anyone have any ideas for how this can be achieved using the API? I'll keep tinkering - I'm not to keen on modifying source code (with a Blueprint license).