image Workshop: Importing Multiple Parts

If you have multiple classes that export the IPersonPart interface that we created in the previous workshop, MEF won't know which part to import into the MyImportedPersonPart property, and will throw an exception when you call CompositionInitializer.SatisfyImports. However, by turning the MyImportedPersonPart property into an array/collection, and using the ImportMany attribute instead of Import, multiple parts can be imported into the MyImportedPersonPart property.

In this workshop, we'll modify what we have from the previous two workshops, and make multiple parts available to the MainPage class.

  1. Add a new ...

Get Pro Business Applications with Silverlight 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.