开发者

Silverlight MEF Embedded Resources

开发者 https://www.devze.com 2022-12-27 07:17 出处:网络
I have two different Silverlight UserControls imported with MEF from two different xaps. The UserControls are simply an Image on a Canvas. Both UserControls have the image marked as \'Resource\'. The

I have two different Silverlight UserControls imported with MEF from two different xaps. The UserControls are simply an Image on a Canvas. Both UserControls have the image marked as 'Resource'. The images are different but their names are the same (key point). I'm not quite sure what's going on behind the scenes of the MEF import but both images seem to end up in the same AppDomain. After the composition when I stick the UserControls on a Canvas, each is an instance of the class it should be, but they both show the same开发者_StackOverflow社区 image.

Obviously if the image file names are unique across all xaps I import I have no problem but I don't like that solution. Is there a better one?


It turns out using an assembly-qualified URI ("/AssemblyShortName;component/Image1.png" instead of "Image1.png") fixed my problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消