Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AvalonDock 2.0 PRISM RegionAdapter with Layout Saving and Loading?

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.

like image 460
Dutts Avatar asked Sep 13 '13 08:09

Dutts


1 Answers

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!

like image 170
Chandramouleswaran Ravichandra Avatar answered Nov 08 '22 11:11

Chandramouleswaran Ravichandra