EventToCommand Missing For Windows Phone App

走远了吗. 提交于 2019-12-22 05:11:59

问题


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"

Errors that I receive:

The name "EventToCommand" does not exist in the namespace "clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WP8"

The type 'command:EventToCommand' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

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.

Thanks


回答1:


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"



回答2:


Replace it with

xmlns:command1="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP8"



回答3:


With the recent version the command moved to Platform assembly:

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


来源:https://stackoverflow.com/questions/19550099/eventtocommand-missing-for-windows-phone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!