Xander
Xander

Reputation: 9171

How does MEF know which parts to import?

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?

Upvotes: 0

Views: 272

Answers (1)

Anderson Imes
Anderson Imes

Reputation: 25650

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.

Upvotes: 1

Related Questions