Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Xamarin Forms Labs MVVM

$
0
0

Hello!

I would like to try the Xamarin.Forms.Labs.Mvvm helper. I create a test viewmodel and a test view and I try to register them in the App.cs like this:

ViewFactory.Register<TestView, TestViewModel>();

At this line I got a null reference exception.

System.NullReferenceException: Object reference not set to an instance of an object
  at at Xamarin.Forms.Labs.Services.Resolver.Resolve<Xamarin.Forms.Labs.Services.IDependencyContainer> () <0x00050>
  at App1.App.GetMainPage () [0x00001] in d:\work\App1\App1\App1\App.cs:16
  at App1.Droid.MainActivity.OnCreate (Android.OS.Bundle) [0x00011] in d:\work\App1\App1\App1.Android\MainActivity.cs:23
  at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (intptr,intptr,intptr) [0x00011] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.App.Activity.cs:2178
  at at (wrapper dynamic-method) object.8037c77c-be2a-4fd1-a778-5e47ef73d412 (intptr,intptr,intptr) <IL 0x00017, 0x0001f>

Can anybody help me what's missing?

Thanks,
Tom


Viewing all articles
Browse latest Browse all 58056

Trending Articles