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

后端 未结 9 2000
花落未央
花落未央 2021-02-02 06:28

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:

相关标签:
9条回答
  • 2021-02-02 06:35

    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>
    
    0 讨论(0)
  • 2021-02-02 06:36

    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.

    0 讨论(0)
  • 2021-02-02 06:38

    I would like to update this question as I found a very easy solution which I'm uncertain was given at the time when this question was initialy raised. Now days you can download a nuget package which will, automatically, fit itself into your solution.

    The package is called "Expression.Blend.Sdk" (by Microsoft) and it contains the version of System.Windows.Interactivity which includes the a version of InvokeCommandAction which has the Command property.

    It's easy to belive that you should install "Blend.Interactivity.Wpf" (by Microsoft) but this nuget package contains another implmentation (I would guess) that doesn't provide a InvokeCommandAction which has the Command property.

    0 讨论(0)
  • 2021-02-02 06:38

    As SQL and Java Learner said in a comment:

    Open the VS Installer and ensure that the Blend SDK is installed, when you do this, you'll have a reference to the 4.5 version without having to modify the config file or some other file. Failing to have the Blend SDK installed means you won't be able to change it from 4 to 4.5.

    This worked for me.

    0 讨论(0)
  • 2021-02-02 06:40

    I had this problem because I was referencing a 4.5 version build of System.Windows.Interactivity but was building my project in .Net 4

    0 讨论(0)
  • 2021-02-02 06:42

    Maybe it could help someone, this problem can be solved by installing the "Blend for Visual Studio SDK for .NET" component, that can be found in Visual Studio 2017 installation:

    If you are using VS2019, but have a VS2017 license available, nothing is needed. Just install VS2017 (core) along with this single individual component.

    0 讨论(0)
提交回复
热议问题