WP71 MVVMLight EventTrigger not recognized

Following the Laurent update guide http://www.galasoft.ch/mvvm/installing/mangobeta/ to move from an existing MVVMLight WP7 project to a WP71 project. I changed links and namespaces in different ways. But EventTrigger is not recognized in XAML

xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    <i:Interaction.Triggers>

        <i:EventTrigger EventName="Loaded">
            <cmd:EventToCommand 
                Command="{Binding Mode=OneWay, Path=LoadedCommand}"
                 PassEventArgsToCommand="True" />
        </i:EventTrigger>
    </i:Interaction.Triggers>

I get an error in the EventTrigger element.

Has this changed?

+3
source share
3 answers

I had the same issue when I upgraded my application from WP7 to WP7.1 (Mango). The problem was MVVM Light Binaries. You need to update the WP7.1 binaries.

(https://stackoverflow.com/users/12233/lbugnion) , MVVM Light - : http://www.galasoft.ch/mvvm/installing/mangobeta/

, :

  • .

  • WP71.

  • MVVM ( C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries)

  • "" GalaSoft.MvvmLight, GalaSoft.MvvmLight.Extras System.Windows.Interactivity.

  • C:\Program Files\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries\WP71.

+2

Mango. EventToCommand MenuItem, , , - . evcent view-bhind. :

this.Loaded+=(s,e)=>ViewModel.LoadedCommand.Execute(null);

:

<tk:MenuItem Header="Delete Snapshot" >
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Click">
            <mvvmLight:EventToCommand Command="{Binding DeleteSnapshotCommand, Mode=OneWay}" CommandParameter="{Binding SelectedItem,ElementName=lstSnapshots}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
</tk:MenuItem>

<tk:MenuItem Header="Delete Snapshot" Command="{Binding DeleteSnapshotCommand, Mode=OneWay}" CommandParameter="{Binding SelectedItem,ElementName=lstSnapshots}" />
+1

I migrated from this problem by returning to the pre-mango dev environment. Not the solution I wanted, but on and on.

0
source

All Articles