2014-10-17 105 views
2

这个有用的类似乎从最新的MVVM Light构建中消失了,任何想法为什么或者如何解决它?MVVM Light上缺少EventToCommand

我正在使用MvvmLightLibs.5.0.1.0,肯定是有MvvmLightLibs.4.1.27.0。所以,这个问题是不是与一个EventToCommand Missing For Windows Phone App

环境相关:VS2013,WP8.0

+0

劳伦比尼翁[发布](http://blog.galasoft.ch/posts/2014/01/using-the-eventargsconverter-in-mvvm-light-and-why-is-there-no- eventtocommand-in-the-windows-8-1-version /)。这是为WP8.1。 – Sjeijoet 2014-10-17 14:43:38

+0

@hantoun我找到了同样的文章,但与我的问题无关,谢谢。 – 2014-10-20 09:35:57

回答

8

最后,我发现Galasoft.MvvmLight.Platform的EventToCommand类。我想装配变化是一个多平台框架。

xmlns:Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform" 

<i:Interaction.Triggers> 
     <i:EventTrigger EventName="Tap" >     
      <Command:EventToCommand Command="{Binding Path=MyVM.MyCommand, Source={StaticResource Locator}}" 
            PassEventArgsToCommand="False"  
            CommandParameter="{Binding}"/> 
     </i:EventTrigger> 
    </i:Interaction.Triggers>