问题描述
我正在使用MVVM Light构建Windows Phone 8应用程序.到目前为止,一切都很好. 但是,当我使用EventToCommand时,出现多个错误.一个类似的问题在这里 EventToCommand在针对SL5迁移到v4时不起作用,可惜它不能解决我的问题.它会自动添加以下参考:
I'm building Windows Phone 8 app using MVVM Light. So far, so good. However, when I used EventToCommand, I get multiple errors. One similar question is here EventToCommand not working when migrate to v4 for SL5, but sadly it doesn't solve my problem.! It automatically adds following reference:
xmlns:command1="http://www.galasoft.ch/mvvmlight"
我收到的错误:
名称空间"clr-namespace:GalaSoft.MvvmLight.Command; assembly = GalaSoft.MvvmLight.WP8"中不存在名称"EventToCommand"
The name "EventToCommand" does not exist in the namespace "clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP8"
找不到类型'command:EventToCommand'.确认您没有丢失程序集引用,并且所有引用的程序集均已构建.
The type 'command:EventToCommand' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
标记'EventToCommand'在XML名称空间'clr-namespace:GalaSoft.MvvmLight.Command; assembly = GalaSoft.MvvmLight.WP8'中不存在
The tag 'EventToCommand' does not exist in XML namespace 'clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP8'
让我知道我是否遗漏了任何东西或做错了什么.
Let me know if I'm missing anything or doing something wrong.
谢谢
推荐答案
以下是正确的xmlns(程序集名称中缺少 Extras ):
Here is the correct xmlns (you were missing Extras in the assembly name):
xmlns:Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"
这篇关于Windows Phone应用缺少EventToCommand的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!