Search code examples
c#wpfvisual-studio

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


Solution

  • Ok, I've got it fixed. When I installed Visual Studio 2012 Professional (with Blend), I had the option to install Blend for Visual Studio. I thought that maybe that caused the problem so I opened the installer again, choosed Modify and unchecked the option Blend for Visual Studio.

    And guess what, it worked. No more errors on the Interaction. This now works fine again! What the actual issue is, I don't know so if anyone does know, do please tell me :)

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