Xamarin.Forms with mvvmcross

GadiPazGadiPaz ILUniversity

I developed my application using mvvmcross and now I want to use Xamarin.Forms.
The moment I install Xamarin.Forms nuget (without even changing one line of code) on the Android project and try to build I get these 3 Exceptions:

2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1054,3): error XA4204: Unable to resolve interface type 'Android.Animation.Animator/IAnimatorListener'. Are you missing an assembly reference?
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1054,3): error XA4204: Unable to resolve interface type 'Android.Widget.SearchView/IOnQueryTextListener'. Are you missing an assembly reference?
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1054,3): error XA4204: Unable to resolve interface type 'Android.Views.View/IOnAttachStateChangeListener'. Are you missing an assembly reference?

I can Build & Run Xamarin samples with Forms,
I think the problem is the integration with mvvmcross, but I may be wrong...

Any Idea?

Posts

  • MichaelRidlandMichaelRidland AUInsider, University ✭✭✭

    Hi

    I had a MvvmCross app that I ported from Xamarin.Forms. I actually removed MvvmCross because Forms already has databinding and I rolled my own Mvvm by filling in some MvvmCross gaps.

    This is how I did it, not sure if it's the best way.

    1) Created a new Forms App

    2) Copied the ViewModels and Views(iOS) into the Forms PCL/Shred

    3) Modified the Views to work with Forms

    4) Filled in the gaps for the ViewModels added TinyIOC.

    So my BaseViewModel has a Push and Pop Methods.

    Check out this Gist.

  • GadiPazGadiPaz ILUniversity

    Thank you very much MichaelRidland,
    Your suggestion looks great, I'm going to check it out today.

    New Xamarin.Forms here I come!!!

Sign In or Register to comment.