MVVM Light上缺少EventToCommand [英] EventToCommand missing on MVVM Light

查看:331
本文介绍了MVVM Light上缺少EventToCommand的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个有用的类似乎已从最新的MVVM Light版本中删除,您知道为什么或如何解决吗?

我正在使用MvvmLightLibs.5.0.1.0,肯定在MvvmLightLibs.4.1.27.0上.因此,此问题与 Windows Phone App缺少的EventToCommand 无关.

环境:VS2013,WP8.0

解决方案

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

This helpful class seems to be gone from the latest MVVM Light build, any idea why or how to work around it?

I'm using MvvmLightLibs.5.0.1.0, was definitely there on MvvmLightLibs.4.1.27.0. So this question is not related with one EventToCommand Missing For Windows Phone App

Environment: VS2013, WP8.0

解决方案

Eventually, I found the EventToCommand class on Galasoft.MvvmLight.Platform. I guess the assembly change makes sense being a multi-platform framework.

 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>

这篇关于MVVM Light上缺少EventToCommand的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆