How to use MEF to init a group of classes?-Collection of common programming errors
I use prism/mvvm/mef for my app, and loading all Views marked with ViewExport(Region) does work nicely (I’m using the StockTraderRI AutoPopulateExportedViewsBehaviour).
Now I’d like to use this runtime lookup capability to initialise some other background classes.
Say I got an interface
public interface ITable
{
}
And I got a lot of classes deriving from this interface.
Is there a way to mark those derived classes somehow and get MEF to create them on runtime and add them into some kind of list or container?
Like into a region which is not shown anywhere, I’d expect? How would I achieve this in MEF?