Skip to content

Instantly share code, notes, and snippets.

@glennblock
Forked from GraemeF/gist:476612
Created July 15, 2010 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glennblock/476615 to your computer and use it in GitHub Desktop.
Save glennblock/476615 to your computer and use it in GitHub Desktop.
private TPart ComposePartWith<TPart, TImport>(TImport import)
{
var catalog = new TypeCatalog(typeof(TPart));
var childContainer = new CompositionContainer(catalog, Container);
childContainer.ComposeExportedValue(import);
return childContainer.GetExportedValue<TPart>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment