How to satisfy a custom import condition using MEF

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

Hello

I,d like to add a field like so

 

class View1 {

[LogType("MyLogAbc-{0}.txt")]

[IMPORT]

ILogger customLogger ;

 

[IMPORT]

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 ?

 

thanks

Developer
Feb 6, 2012 at 9:07 PM

Hi,

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.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami