IRegionManager injecting as MefRegionManager

Topics: Prism v4 - WPF 4
Oct 3, 2012 at 5:53 PM
Edited Oct 3, 2012 at 5:54 PM
  • MEF, WPF, .Net4

In my main project we inject scoped region managers everywhere typically using importing constructors.

In every case I've checked the object is declared as IRegionManager, imported as the same and at run time shows as {Microsoft.Practices.Prism.Regions.RegionManager}

I have a separate project I'm building based on the main as an example to share code which declares and injects the variables the same way, but I'm running into some problems injecting views.  In trying to troubleshoot the issue I noticed my region managers show up at run time as {Microsoft.Practices.Prism.MefExtensions.Regions.MefRegionManager}

The errors I'm having are unexpected so I'm trying to rule out the difference in region manager types.

Any reason they would be different?

Thanks

Developer
Oct 3, 2012 at 7:41 PM

Hi,

As far as I know the MefRegionManager class implementation does not differ from the RegionManager class, this is a derived class from the Microsoft.Practices.Prism.Regions.RegionManager class, used to export and expose this type using the Managed Extensibility Framework (MEF).

The Prism team created derived classes like this one, in the Microsoft.Practices.Prism.MefExtensions assembly that derived from the types they wanted to expose in order to ensure that the core Prism libraries were not container-specific.

Perhaps, it would be helpful if you could provide us with more information about the problem you are experiencing, so we that can help you further with this.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami

Oct 3, 2012 at 8:13 PM

That's all I needed for now.  I was getting distracted by the different derived class while trying to resolve a different issue.

It's the usual "view already exists" that I've deal with many times before, I wanted to make sure the problem wasn't coming from somewhere new.

I'll post again if I need more help with it, thanks.