Auto Create only some Tool Windows when loading dock site from serializer

Docking/MDI for WPF Forum

Posted 10 months ago by Paul White
Version: 21.1.2
Avatar

Hi there,

In our app we are using Prism and have used code from the Prism integration sample.  We are also serializing the dock site for each user and saving it when they log out and applying it when they log in.  We are using lazy loading and this is working fine in that the previous size and position of each windows is used when the user opens a window.  Some of the windows can only be opened once the user has selected some data so we cannot auto create them and hence using lazy loading. Other windows we want to auto create if they were left open at the end of the previous session. From the xml I can see the tool windows are correctly serialized with their open states but because they are lazy loaded there is no way to access them once the dock site is loaded. 

Is there a way to auto create some windows and not others? 

Regards

Paul

Comments (2)

Answer - Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Paul,

If you leave the DockingWindowDeserializationBehavior.LazyLoad feature set, when the serializer's DockingWindowDeserializing event fires, the e.Window would be null for any ToolWindow or DocumentWindow that would have been created if AutoCreate mode was set.  What you can do is set the e.Window property yourself to a new ToolWindow instance that copies the Name and SerializationId from the e.Node for those you wish to manually auto-create.


Actipro Software Support

Posted 10 months ago by Paul White
Avatar

Hi,

The DockingWindowDeserializing event was exactly what I needed.  It was then fairly simply to create any windows which needed to be opened.

Thanks very much. 

Paul

The latest build of this product (v24.1.2) 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.