I have a main Silverilght project and other modules and I'm using Prism to glue them together along with Unity for Dependency Injection.
I have one of my modules that depends on an IRegionManager
which, naturally, gets injected to it by Unity.
The issue I'm running to is that, the Regions
property of the RegionManager
that I get doesn't contain any regions even though I have declared two of them in my Shell as follows:
regions:RegionManager.RegionName="MainRegion"
I can't figure out the reason of this behavior. I've tried registering a RegionManager
as a singleton using
Container.RegisterInstance<IRegionManager>(new RegionManager());
as well as leaving unity handle this. However, I got the same results :(
what I'm trying to achieve is to inject a view into a particular region and activate it, which can't be done using
_regionManager.RegisterViewWithRegion("MainRegion", typeof(MyView));
that's why I need to get hold of the "MainRegion" object itself and manipulate it.
I hope somebody has this figured out. I would be very thankful :)
Edit:
I should mention that the view discovery works just fine, I can RegisterViewWithRegion
, but when I check the Regions
property of the RegionManager
, I find it empty!