dependency injection - How to use MEF to init a group of classes? -


i use prism/mvvm/mef app, , loading views marked viewexport(region) work nicely (i'm using stocktraderri autopopulateexportedviewsbehaviour).

now i'd use runtime lookup capability initialise other background classes.

say got interface

public interface itable { } 

and got lot of classes deriving interface.

is there way mark derived classes somehow , mef create them on runtime , add them kind of list or container?

like region not shown anywhere, i'd expect? how achieve in mef?

sure there is! mark classes inheriting interface export attribute , in class create property of generic type observablecollection attribute [importmany]. should trick.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -