wpf 属性不存在:System.Windows.Interactivity?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14575411/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-13 07:16:29  来源:igfitidea点击:

Properties does not exist: System.Windows.Interactivity?

wpf

提问by Hyde

I have C#/WPF that has a persistent problem loading/resolving the System.Windows.Interactivity I am using Visual Studio 2010 as my editor and already installed Blend 4 + Blend 4 SDK,

我有 C#/WPF,它在加载/解决 System.Windows.Interactivity 时一直存在问题 我使用 Visual Studio 2010 作为我的编辑器,并且已经安装了 Blend 4 + Blend 4 SDK,

......

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">

......

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">

Why still return result Assembly was not found? Like my class library CustomBehaviorLibrary was missing?

为什么仍然返回结果Assembly not found?就像我的类库 CustomBehaviorLibrary 丢失了一样?

回答by Alan

If it worked at runtime but not design-time then I am blaming VS 2010 for being buggy. I've had VS 2010 not recognize the local namespace when imported into XAML, but when opened in VS 2012 it worked in the designer with no problems. Unfortunately, Visual Studio 2010's XAML/WPF support is far from perfect. Expression Blend or Visual Studio 2012 are better.

如果它在运行时有效但在设计时无效,那么我将责怪 VS 2010 有问题。我让 VS 2010 在导入 XAML 时无法识别本地命名空间,但是在 VS 2012 中打开时,它在设计器中正常工作,没有任何问题。不幸的是,Visual Studio 2010 的 XAML/WPF 支持远非完美。Expression Blend 或 Visual Studio 2012 更好。

I did like ViktorLaCroix 's suggestion. I would try

我确实喜欢 ViktorLaCroix 的建议。我会尝试

xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"

Instead of importing it using clr-namespace and see if that helps you. That's how I am using it and it works fine. I'll also show you my reference details for the library.

而不是使用 clr-namespace 导入它,看看是否对您有帮助。这就是我使用它的方式,它工作正常。我还将向您展示我对该库的参考详细信息。

System.Windows.Interactivity
C:\Program Files (x86)\Microsoft SDKs\Expression\Blend\.NETFramework\v4.0\Libraries\System.Windows.Interactivity.dll
v4.0.30319

回答by seabass2020

The easiest way might be to get it from NuGet:

最简单的方法可能是从 NuGet 获取它:

To install System.Windows.Interactivity v4.0 for WPF, run the following command in the Package Manager Console

要为 WPF 安装 System.Windows.Interactivity v4.0,请在包管理器控制台中运行以下命令

PM> Install-Package System.Windows.Interactivity.WPF

PM> 安装包 System.Windows.Interactivity.WPF

http://www.nuget.org/packages/System.Windows.Interactivity.WPF/

http://www.nuget.org/packages/System.Windows.Interactivity.WPF/