如何在MEF中获取Metro风格应用程序的导出值 [英] How can I get an exported value in MEF for metro style apps
本文介绍了如何在MEF中获取Metro风格应用程序的导出值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个类似的接口:
public Interface MyInterface
{
}
实现接口的类:
[Export(typeof(MyInterface))]
public class MyClass:MyInterface
{
}
在正常的MEF版本中,我可以从容器中获取导出值:
MyInterface value = container.GetExportedValue< MyInterface>();
如何在Metro风格的应用程序中执行此操作?我不是要求SatisfyImportOnce方法!
谢谢&最好的问候,
Michael
解决方案
<我也对这个问题的答案感兴趣!为什么Microsoft删除了"CompositionContainer"?类?在我看来,没有这门课,MEF就没用了。
再见,
塞巴斯蒂安
I have an Interface like:
public Interface MyInterface { }
And a class implementing the interface:
[Export(typeof(MyInterface))] public class MyClass : MyInterface { }
In the normal MEF Version I can get the exported value from the container:
MyInterface value = container.GetExportedValue<MyInterface>();
How I can do this in Metro style apps? Im not asking for the SatisfyImportOnce method!
Thanks & Best regards,
Michael
解决方案
Hi,
I am also interested in an answer to the question! Why has Microsoft removed the "CompositionContainer" class? In my opinion is MEF useless without this class.
Bye,
Sebastian
这篇关于如何在MEF中获取Metro风格应用程序的导出值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文