0
所以我使用mvvm light 5與Xamarin Android項目。我一直在關注這個教程:Xamarin Android AddBinding AddCommand問題
http://blog.galasoft.ch/posts/2014/05/mvvm-light-v4-4-with-xamarin-android-support/
然而,當我到達的步驟,其中我需要添加綁定和命令,我得到的符號沒有找到AddBinding和AddCommand錯誤。
具體來說,我說的是下面的代碼:
this.AddBinding(
() => Vm.Hello,
() => MyButton.Text);
MyButton.AddCommand(
"Click",
Vm.IncrementCommand);
此外,該教程似乎沒有提及如何設置的綁定axml佈局。
我期待像
<Label text={Binding textFromDataContext} />
任何幫助表示讚賞。
謝謝。
您是否在使用Android Studio?如果是這樣看到這個:http://stackoverflow.com/questions/21341534/symbol-not-found-but-builds-and-run-ok-on-android-studio –
不,這不是原生的android(如在Java中) 。這是C#Xamarin,所以我使用Visual Studio。 – whaider
看起來我正在遵循過時的教程。實際的功能是SetBinding和SetCommand。但是,現在我的項目不會建立。我收到此錯誤: 加載程序集時出現異常:System.IO.FileNotFoundException:無法加載程序集'Microsoft.Practices.ServiceLocation,Version = 1.3.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35'。也許它不適用於Android個人資料的Mono中? – whaider