EventToCommand不起作用

EventToCommand不起作用

本文介绍了迁移到SL5 v4时,EventToCommand不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有带有MVVMLight的SL4应用程序.我将其迁移到SL 5并在编译应用时出现以下错误:

I have SL4 app with MVVMLight. I migrate it to SL 5 and got following error when compiling the app:

标记"EventToCommand"在XML名称空间中不存在'clr-namespace:GalaSoft.MvvmLight.Command; assembly = GalaSoft.MvvmLight.SL5

The tag 'EventToCommand' does not exist in XML namespace'clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.SL5

此错误的xaml是:

  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
  xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.SL5"

<i:Interaction.Triggers>
   <i:EventTrigger EventName="MouseLeftButtonUp">
       <cmd:EventToCommand Command="{Binding ResetPasswordCommand,Mode=OneWay}"
        MustToggleIsEnabledValue="True" />
    </i:EventTrigger>
</i:Interaction.Triggers>

很困惑.已经为新平台更新了所有程序集.如何解决这个问题?

quite confused. Have update all assemblies for new platform. How to resolve this problem?

推荐答案

弄清楚:应该使用assembly = GalaSoft.MvvmLight.Extras.SL5而不是assembly = GalaSoft.MvvmLight.SL5.谢谢.

Figure it out: should use assembly=GalaSoft.MvvmLight.Extras.SL5 instead of assembly=GalaSoft.MvvmLight.SL5.Thanks.

这篇关于迁移到SL5 v4时,EventToCommand不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 08:36