0
votes

Currently I use unity and prism.

If I want to put stuff into unity i do it at the module level.

How do I do it with MEF?

I see that I add exports to the class, but how does MEF know to add these? Does it do it by class library? is there a way to link it to modules?

1

1 Answers

1
votes

MEFContrib has a "MEF + Unity Integration" project you should look at. Here's a blog post about it: http://pwlodek.blogspot.com/2009/05/unity-mef-integration-layer.html

It makes MEF aware of Unity and vice-versa. Pretty nice.

As for "How does MEF work", I would suggest watching this excellent video: http://channel9.msdn.com/Shows/SilverlightTV/Silverlight-TV-Episode-4-3-Steps-to-MEF-Export-Import-Compose

It shows all of the component parts of MEF and how they work together.