c# - MEF InheritedExport metadata -
i have experience simple usage of mef. want know how best following done.
- i have interface class
[inheritedexport] public interface ibaseview { }
- i have multiple implementation classes following:
[partcreattionpolicy(partcreationpolicy.nonshared), exportmetadata("displayname", "simpleview") public class simpleview : ibaseview { //implementation }
- somewhere else, need enumerate
displayname
metadata exports present in container. (to show user). means not want create export, inspect type's metadata.
how do this?
have checked exportfactory comes mef 2? helps creating export instances dynamically. refer this msdn article exportfactory, , stack overflow answer on how use mef.
you can access metadata factory without creating export.
Comments
Post a Comment