【问题标题】:EventToCommand missing on MVVM LightMVVM Light 上缺少 EventToCommand
【发布时间】:2014-10-17 08:55:42
【问题描述】:

这个有用的类似乎从最新的 MVVM Light 版本中消失了,知道为什么或如何解决它吗?

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

环境:VS2013,WP8.0

【问题讨论】:

  • Laurent Bugnion posted 关于这个。但它适用于 WP8.1。
  • @hantoun 我在谷歌上搜索到同一篇文章,但它与我的问题无关,谢谢。

标签: xaml windows-phone-8 mvvm mvvm-light eventtocommand


【解决方案1】:

最终,我在 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>

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-18
  • 2011-12-23
  • 2015-09-26
  • 2013-02-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多