从Prism应用程序引用正确的System.Windows.Interactivity dll [英] Referencing the correct System.Windows.Interactivity dll from Prism application

查看:189
本文介绍了从Prism应用程序引用正确的System.Windows.Interactivity dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在构建的WPF Prism应用程序.该应用程序到了我希望能够向控件添加EventTriggers的地步,因此我可以在基础视图模型上调用命令.但是,我似乎无法引用正确的DLL来使项目运行.当前,我从C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries目录引用Microsoft.Expression.InteractionsSystem.Windows.Interactivity.

I have a WPF Prism application that I'm building. The application is to the point where I want to be able to add EventTriggers to controls so I can call commands on the underlying view model. However, I can't seem to reference the correct DLLs to make the project run. Currently, I'm referencing Microsoft.Expression.Interactions and System.Windows.Interactivity from the C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries directory.

运行模块时,出现此错误:

When I run the module, I get this error:

无法加载文件或程序集'System.Windows.Interactivity,
PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.
系统找不到指定的文件.

Could not load file or assembly 'System.Windows.Interactivity,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.

我检查了反射器中的System.Windows.Interactivity组件,可以看到它引用了:

I checked the System.Windows.Interactivity assembly in reflector and can see that it references:

  • mscorlib
  • PresentationCore
  • PresentationFramework
  • 系统
  • System.Core
  • System.Xaml
  • WindowsBase

所有引用均指向4.0框架.我已经从.NET引用选项卡中引用了每一个,确保每个都是4.0版本.所有这些引用都是从C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0目录加载的.

All the references point to the 4.0 framework. I've referenced each from the .NET reference tab, making sure that each one is the 4.0 version. All these references are being loaded from the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0 directory.

在我的环境中需要System.Windows.InteractivityMicrosoft.Expression.Interactions程序集需要其他下载吗?

Is there another download I need for the System.Windows.Interactivity and Microsoft.Expression.Interactions assemblies to work in my environment?

推荐答案

出于某些我仍然无法理解的原因,Prism包含了自己的Blend SDK程序集版本.因此,您应该从Prism发行版的Lib \ Desktop文件夹(假设您使用的是Prism v4)而不是从Blend SDK的安装中引用Microsoft.Expression.Interactions.dll和System.Windows.Interactivity.dll.

For some reason that I still cannot fathom, Prism includes it's own version of the Blend SDK assemblies. So you should reference Microsoft.Expression.Interactions.dll and System.Windows.Interactivity.dll from the Lib\Desktop folder of the Prism distribution (assuming you're using Prism v4) rather than from the Blend SDK installation.

这篇关于从Prism应用程序引用正确的System.Windows.Interactivity dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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