In the Feature Browser, the sample for SaveLayout and LoadLayout works for panes that are created statically in the xaml. Do you have an example of Save(and Load)Layout when the user has dynamically loaded documents and moved them around?
If no example, do you have any advice to help me extend these methods to perhaps save the Type of the class contained in the SplitPane, then load that Type before setting the docking position of the contentpane? After working with these methods over the weekend, I see that the xml generated by the SaveLayout method identifies the contentpane by its Name. But the LoadLayout method does not actually create the instance of this object if it does not exist in the xaml. That's what I need to do.
Thanks in advance for any guidance you can provide.
WHen handling the event you just need to initialize the e.Pane or create a ContentPane and set the e.Pane property. You don't need to put it into the dockmanager. It will put it where it belongs based on the info in the layout file you are loading.
While handling InitializePaneContent, how should one decide whether this new ContentPane should be part of DocumentConentHost or not?
At the point at which the event is fired, nothing has been put into the splitpanes, tabgrouppanes, etc. so you cannot do that at that point. In theory you could leave that pane in there and then remove it after the load but if there were any ContentPanePlaceholders created for the old positions of the pane it will reference the pane we created during the load. You should submit the issue to the support group.
Thanks again for your assistance. We're almost there...
I am able to save the various class types that I need in the SerializationID of the ContentPane. (I am saving two class types: a class type derived from ContentPane and a type of Page that is shown in a Frame within the ContentPane)
However, when I handle the InitializePaneContent event, setting the content of the NewPane will not achieve what I am looking for. I am trying to show an instance of a class derived from ContentPane (which we call BaseDockableContent in our project). The code behind the class is certainly required for the pane to function. I can't just copy its content to the NewPane and NewPane is read-only, so I can't replace it with my class instance.
Is there a way to get a reference to the SplitPane that is targeted by NewPane? Then allow the NewPane to be destroyed, but add my new instance of BaseDockablePane to the target SplitPane of the XamDockManager?
Thanks again for your assistance.
Excellent! Thank you for the quick reply! I will give that a try.