MEF和XAML,检索CompositionContainer [英] MEF and XAML, Retrieving the CompositionContainer

查看:56
本文介绍了MEF和XAML,检索CompositionContainer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对导出的MEF类型的数据进行XAML绑定(使用VS2010和VB.NET)。 我已经设法使用一个带有WPF应用程序的项目和一个包含导出数据的类来获得一些东西。 但是
我必须通过My.Application使我的CompositionContainer可以访问该类,以便使用GetExportedValue检索值。

I'm attempting to make XAML bindings to data that is an exported MEF type (using VS2010 and VB.NET).  I've managed to get something going using a single project with a WPF Application and a Class which contains the exported data.  However I have to make my CompositionContainer accessible to the class through My.Application in order to retrieve the values using GetExportedValue.

下一步将是XAML和/或正在使用数据与创建CompositionContainer并进行编写的模块位于不同模块中的类。 如何从其他模块中获取CompositionContainer? 
我尝试用MEF导出它,但导入值总是没有。

The next step would be for the XAML and/or Class that was using the data to be in a different module from the one creating the CompositionContainer and doing the composing.  How do I get hold of the CompositionContainer from a different module?  I've tried exporting it with MEF but the import value is always nothing.

或者,有更好的方法将XAML与MEF一起使用吗?

Or, is there a better way of using XAML with MEF?

推荐答案

你在这里找到了解决方案吗?
Did you find a solution here?


这篇关于MEF和XAML,检索CompositionContainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆