How to register RegionAdapter in app.config?

Topics: Prism v2 - Silverlight 2, Prism v2 - Silverlight 3, Prism v2 - WPF 3.5
Aug 3, 2009 at 4:53 PM


How to register or map a custom regaion adapter in app.config? Let's say I have Tab Control Region Adapter, Windows Region Adapter. Module developers will use only "region" but Infrastructure developer will define what custom region adapter will be used in the system. What adapter we will use in the system should be transparnet to the module-level developer. I think I can create one abstraction layer for that. But I'm wondering if I can specify the mapping in app.config so no need of creating any abstraction layer. 

Thanks in advance. 



Aug 4, 2009 at 4:48 PM

Hi Michael,

In Prism there is not out of the box way to register region adapters through a configuration file. However, to suit your objective you can simply register the RegionAdapters in the Bootsrapper overriding the ConfigureRegionAdapterMappings method.
In the ConfigureRegionAdapterMappings method you could also read the app.config file and register the adapters dynamically. This will allow you to change the adapters without recompilation.
This will automatically allow your entire application to use those adapters, without any need of knowledge from the “module level” developers.

Please let me know if this helps.

Damian Schenkelman