Has anyone managed to successfully load and save layout using dynamically injected views from Prism modules and AvalonDock?
I have a RegionAdapter for the AvalonDock DockingManager which allows me to register views using the RegionViewRegistry in my Prism modules and they get wrapped by LayoutAnchorable objects in AvalonDock.
This all works fine, except when saving and loading layout. When I add a view from my module, it goes through the RegionAdapter and gets serialised properly (I have a post serialisation step that adds some custom XML to the output to give me some information about the modules that were displayed in which LayoutAnchorable).
When I load the layout, I implement the LayoutSerializationCallback, set the content to the appropriate module's view and it displays properly.
The problem is if I subsequently try to serialise this, I never get the LayoutAnchorables that were added in the deserialisation.
I'm interested in hearing from anyone who managed to create AvalonDock + Prism + layout saving and loading.
I'm evaluated both Infragistics and SyncFusion's DockManagers and have had even less success, neither of them provide a callback on the deserialisation to allow me to inject my custom view.
I tried this around a year back and gave up because the MVVM based sample app with AvalonDock worked fine for me.. I understand what the region adapter solves, but it wasn't necessary for my application.
I use PRISM (for services and modularity) + AvalonDock (docking) + Layout saving in my personal project Wide without a region adapter. There are a few other projects - SharpDevelop, Gemini which use AvalonDock + loading/saving without PRISM though. #D builds its own framework for modularity and Gemini uses Caliburn.Micro framework.
Overall, I would suggest you to take a look at the above mentioned open source projects to see if you can find something useful from it. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With