问题
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
- Blend 3 + Blend 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).
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.
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'.
Do I need to install Blend 4 RC or something?
回答1:
If you don't have Blend 4, you can just install the Blend 4 SDK by itself to get the current behavior assemblies.
回答2:
@TomTom and all SDK 4.0 suggestors:
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.
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.
@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?)
Addendum:
The solution is:
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
回答3:
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.
回答4:
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.
回答5:
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).
回答6:
Installing the NuGet package Microsoft Expression Blend SDK maintained by JetBrains will solve the issue.
Install-Package JetBrains.System.Windows.Interactivity
来源:https://stackoverflow.com/questions/3059821/the-tag-interaction-behaviors-does-not-exist-in-vs2010-blend-3