0

So I am using mvvm light 5 with a Xamarin Android project. I have been following this tutorial:

http://blog.galasoft.ch/posts/2014/05/mvvm-light-v4-4-with-xamarin-android-support/

However when I get to the step where I need to add the bindings and commands, I get symbol not found errors for AddBinding and AddCommand.

Specifically I am talking about the following code:

    this.AddBinding(
        () => Vm.Hello,
        () => MyButton.Text);

    MyButton.AddCommand(
        "Click",
        Vm.IncrementCommand);

Additionally the tutorial doesn't seem to mention how to setup the axml layout for the bindings.

I was expecting something like

    <Label text={Binding textFromDataContext} />

Any help is appreciated.

Thanks.

whaider
  • 11
  • 1
  • Are you using Android Studio? If so see this: http://stackoverflow.com/questions/21341534/symbol-not-found-but-builds-and-run-ok-on-android-studio – Mr. Concolato Jan 07 '15 at 15:39
  • No this is not native android (as in Java). This is C# Xamarin so I am using Visual Studio. – whaider Jan 07 '15 at 15:40
  • Looks like I was following an outdated tutorial. The actual functions are SetBinding and SetCommand. However, now my project won't build. I get this error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Practices.ServiceLocation, Version=1.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Perhaps it doesn't exist in the Mono for Android profile? – whaider Jan 07 '15 at 15:47

1 Answers1

0

I resolved the FileNotFoundException by manually installing the nuget package CommonServiceLocator in the Droid project

Loul G.
  • 997
  • 13
  • 27