Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The name "Interaction" does not exist in the namespace "http://schemas.microsoft.com/expression/2010/interactivity"

I've used the System.Windows.Interactivity DLL in several projects without any problem. Now in my latest project I can't get it to work. I always get the following error:

The name "Interaction" does not exist in the namespace "http://schemas.microsoft.com/expression/2010/interactivity".

<i:Interaction.Triggers>     <EventTrigger EventName="SelectionChanged">         <i:InvokeCommandAction Command="{Binding AddSelectLocomotifCommand}"             CommandParameter="{Binding SelectedItem, ElementName=listBoxLocs}" />     </EventTrigger> </i:Interaction.Triggers> 

And the namespace:

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

Both Microsoft.Expression.Interactions and System.Windows.Interactivity are added to the projects references and I even copied the DLL's to a folder within my project.

Any idea how this comes? I use VS2012 with .NET 4.5

like image 889
PitAttack76 Avatar asked Dec 23 '13 12:12

PitAttack76


2 Answers

  1. Remove any project reference to Microsoft.Expression.Interactions and System.Windows.Interactivity.

  2. Install through Nuget the newer Microsoft.Xaml.Behaviors.Wpf, which replaces the aforementioned references, i.e. open the Package Manager console and type:

    Install-Package Microsoft.Xaml.Behaviors.Wpf ProjectName

  3. In the Xaml-files, replace the xmlns namespaces http://schemas.microsoft.com/expression/2010/interactivity and http://schemas.microsoft.com/expression/2010/interactions with http://schemas.microsoft.com/xaml/behaviors

like image 100
Peter Centellini Avatar answered Oct 08 '22 19:10

Peter Centellini


If you have this problem before everything else double check if you have reference to both Microsoft.Expression.Interactions AND System.Windows.Interactivity.

I just want to warn, that I tried to do everything like PitAttack76 wrote on his answer and it didn't uninstall Blend for me. It just uninstall some parts so when I restart my computer and want to open the project in Blend it writes an error message as in this thread. Than I have to install .NET framework 4.5.1 and Microsoft Build Tools 2013 to Blend start working again. Nevertheless it didn't help me in any way - my problem was, that I have only Microsoft.Expression.Interactions in my references.

like image 39
Artholl Avatar answered Oct 08 '22 19:10

Artholl