wpf VS2010 (Blend 3) 中不存在标签“Interaction.Behaviors”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3059821/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The tag 'Interaction.Behaviors' does not exist in VS2010 (Blend 3)
提问by Andre Luus
There seems to be a problem with support for the Interactivity namespace of Blend 3 in the VS2010 xaml editor. I have the following installed:
VS2010 xaml 编辑器中对 Blend 3 的 Interactivity 命名空间的支持似乎存在问题。我安装了以下内容:
- VS2010
- Blend 3 + Blend 3 SDK
- VS2010
- 混合 3 + 混合 3 SDK
I am trying to compile a demo project that is targeted at .Net 4 Client Profile and has a reference to System.Windows.Interactivity (in the Blend 3 folder).
我正在尝试编译一个针对 .Net 4 Client Profile 并引用 System.Windows.Interactivity(在 Blend 3 文件夹中)的演示项目。
In the object browser everything appears to be fine. I can also access Interaction.Behaviours from code-behind, but if I put the namespace xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
in the xaml file and try to use it, the intellisense is blank.
在对象浏览器中,一切似乎都很好。我也可以从代码隐藏访问 Interaction.Behaviours,但是如果我将命名空间xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
放在 xaml 文件中并尝试使用它,则智能感知是空白的。
If I copy something in there anyway, the compiler says:
The tag 'Interaction.Behaviors' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.
如果我在那里复制一些东西,编译器会说:
The tag 'Interaction.Behaviors' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.
Do I need to install Blend 4 RC or something?
我需要安装 Blend 4 RC 还是什么?
采纳答案by Adam Kinney
If you don't have Blend 4, you can just install the Blend 4 SDKby itself to get the current behavior assemblies.
如果您没有 Blend 4,您可以自行安装Blend 4 SDK以获取当前行为程序集。
回答by Christoph
@TomTom and all SDK 4.0 suggestors:
@TomTom 和所有 SDK 4.0 建议者:
There is a huge killer criteria that prevents many develpers like me from downloading and using SDK 4.0 even if it is for free: It uses .NET 4.0.
有一个巨大的杀手标准阻止像我这样的许多开发人员下载和使用 SDK 4.0,即使它是免费的:它使用 .NET 4.0。
You may ask what's wrong with .NET 4.0? Nothing, except as for today (2013-06-13) still many of our customers don't have it installed on their servers (on the clients it's usually no problem). So if you develop software that should also run on servers, you are forced to use .NET 3.5 even if .NET 4.5 would be state-of-the-art.
您可能会问 .NET 4.0 有什么问题?没有,除了今天(2013-06-13),我们的许多客户仍然没有在他们的服务器上安装它(在客户端上通常没有问题)。因此,如果您开发的软件也应该在服务器上运行,即使 .NET 4.5 是最先进的,您也必须使用 .NET 3.5。
@everybody
@大家
Does anybody have a solution to Andre Luus original question? How must the namespace import in XAML look like in VS2010 if "System.Windows.Interactivity.dll" of Blend SDK 3.5 for WPF is referenced? (Or was <i:Interaction.Behaviors> named differently in 3.5?)
有人对 Andre Luus 最初的问题有解决方案吗?如果引用了 Blend SDK 3.5 for WPF 的“System.Windows.Interactivity.dll”,XAML 中的命名空间导入在 VS2010 中必须如何?(或者 <i:Interaction.Behaviors> 在 3.5 中的命名是否不同?)
Addendum:
附录:
The solution is:
解决办法是:
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
回答by Alkampfer
The answer from adam linked to the Blend SDK 4.0 for silverlight, if you have this problem in WPF programs you should install this version instead.
来自 adam 的答案链接到 Silverlight 的 Blend SDK 4.0,如果您在 WPF 程序中遇到此问题,则应改为安装此版本。
回答by sergiol
Behavior and MouseDragElementBehavior belong to Microsoft.Expression.Interaction.dll and System.Windows.Interactivity.dll, please add references to those two assemblies and then rebuild your solution.
Behavior 和 MouseDragElementBehavior 属于 Microsoft.Expression.Interaction.dll 和 System.Windows.Interactivity.dll,请添加对这两个程序集的引用,然后重建您的解决方案。
回答by TomTom
Get Blend 4 - free upgrade for you. Available for download at Microsoft (get the trial, it will auto-activate after install if Blend 3 is installed).
获取 Blend 4 - 免费升级。可在 Microsoft 下载(获取试用版,如果安装了 Blend 3,它将在安装后自动激活)。
回答by Mircea Matei
Installing the NuGet package Microsoft Expression Blend SDK maintained by JetBrains will solve the issue.
安装 JetBrains 维护的 NuGet 包 Microsoft Expression Blend SDK 将解决该问题。
Install-Package JetBrains.System.Windows.Interactivity