I’m writing an IntelliSense implementation and I’m trying to get access to VisualStudio’s icon set. I understand you’re meant to use MEF and somehow the property/field you import should be automatically populated. Currently I have:
[Import]
public IGlyphService GlyphService { get; set; }
GlyphService is always null. What am I missing?
Apparently you do indeed have to manually populate and compose a CompositionContainer. My solution looks something like this:
After running this the current object (or the one you have selected in compose parts) will have it’s Imports populated. I ran into a couple of issues with this, including needing to have the referenced dll’s in the program’s bin folder.