2013-10-23 131 views
7

我正在構建使用MVVM Light的Windows Phone 8應用程序。到現在爲止還挺好。 但是,當我使用EventToCommand時,出現多個錯誤。一個類似的問題在這裏EventToCommand not working when migrate to v4 for SL5,但遺憾的是它不能解決我的問題。它自動添加以下參考:EventToCommand缺少Windows Phone應用程序

名稱 「EventToCommand」 不存在於命名空間「CLR-名稱空間::我接收

xmlns:command1="http://www.galasoft.ch/mvvmlight" 

錯誤GalaSoft.MvvmLight.Command;裝配= GalaSoft.MvvmLight。 WP8「

未找到類型'command:EventToCommand'。驗證您是否缺少程序集引用,並且所有引用的程序集都已構建。

標籤「EventToCommand」不存在XML命名空間存在「CLR的命名空間:GalaSoft.MvvmLight.Command;裝配= GalaSoft.MvvmLight.WP8」

讓我知道如果我錯過了什麼或做什麼錯誤。

感謝

回答

8

這裏是正確的xmlns(你在程序集名失蹤額外):

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

非常感謝Olivier提供即時和正確的答案。 :) –

4

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

更換它隨着最近版本的命令轉移到平臺組裝:

xmlns:command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform" 
相關問題