How to satisfy a custom import condition using MEF

Topics: Prism v4 - WPF 4
Feb 3, 2012 at 8:41 PM


I,d like to add a field like so


class View1 {



ILogger customLogger ;



ILogger commonLogger ;




where commonLogger writes to the default log and customLogger writes to the logfile specified in the LogType attribute where {0} is filled with an instance #

e.g. - if there is only 1 instance then the log file is MyLogAbc-1.txt

for the next instance MyLogAbc-2.txt etc


Is this possible ?



Feb 6, 2012 at 9:07 PM


Based on my understanding this is not supported by Prism from out of the box.

Also, as this is not strictly related to Prism, I believe you might find better support regarding this subject, for example in MEF Community Site.

Additionally you could find useful information in the MEF Programming Guide.


Agustin Adami