Error - The attachable property 'Triggers' was not found in type 'Interactivty'

Nov 19, 2010 at 6:46 PM

I downloaded the mvvm-light 3.5SP1 (2) download that shows on the main page.  When I attempt to add any triggers, I get this error:

Error 1 The attachable property 'Triggers' was not found in type 'Interactivty'. C:\Projects\RemedyReports\CSMReport\CSMReport.xaml 25 8 RemedyReports.CSMReport

The XAML Definition looks this:

 

<Window x:Class="RemedyReports.CSMReport.CSMReport"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras"
  Title="CSM Report" Height="300" Width="800">

<StackPanel>
<Button Grid.Column="2" Grid.Row="0" Content="Get Report">
<i:Interactivty.Triggers>
  <i:EventTrigger EventName="Click">
   <cmd:EventToCommand Command="{Binding SubmitClick}" />
  </i:EventTrigger>
</i:Interactivty.Triggers>
</Button>
</StackPanel>
</Window>

I can't see anything wrong...  Is there maybe a bug in the version I downloaded?

Coordinator
Nov 19, 2010 at 7:01 PM

Hi,

 This typically happens when you referenced the wrong version of the DLL. For example, if your project is .NET 4 (WPF 4), make sure that you use the DLLs located in the folder C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WPF4

 Hope that helps,

Laurent

Nov 19, 2010 at 7:09 PM

I am referencing: C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WPF35SP1\System.Windows.Interactivity.dll

I think that should be the correct DLL for WPF 3.5, and my project is a WPF 3.5 application...  It's funny because the EventToCommand sample from your website works if I use the DLLs in it, but I can't seem to get it work if I use the DLLs from the download from codeplex.

Here are the refences from the .csproj file

<Reference Include="GalaSoft.MvvmLight, Version=3.0.0.31869, Culture=neutral, PublicKeyToken=3e875cdb3903c512, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WPF35SP1\GalaSoft.MvvmLight.dll</HintPath>
    </Reference>
    <Reference Include="GalaSoft.MvvmLight.Extras, Version=3.0.0.31868, Culture=neutral, PublicKeyToken=48c5515dce1bf64d, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WPF35SP1\GalaSoft.MvvmLight.Extras.dll</HintPath>
    </Reference>
    <Reference Include="System.Windows.Interactivity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\..\..\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WPF35SP1\System.Windows.Interactivity.dll</HintPath>
    </Reference>

Nov 19, 2010 at 8:37 PM

I'm not sure what the problem is, but VS2008 always displays that error.  The moment I loaded the project in VS2010, it worked fine.

Coordinator
Nov 19, 2010 at 9:43 PM

That's weird. I don't have VS2008 installed anymore but I will fire a VM and try to check this out. Sorry for the issue.

Cheers,

Laurent