title: How to use a MonoDroid TabActivity using MvvmCross framework
body: <p>I'm trying to use a TabActivity with MvvmCross but I am getting a NullReferenceException in the framework code because the viewModelLoader passed in to the OnViewCreate is null</p>
  
  <pre><code>namespace Cirrious.MvvmCross.ExtensionMethods
  {
      public static class MvxViewExtensionMethods
      {
          public static void OnViewCreate&lt;TViewModel&gt;(this IMvxView&lt;TViewModel&gt; view, Func&lt;TViewModel&gt; viewModelLoader)
              where TViewModel : class, IMvxViewModel
          {
              if (view.ViewModel != null)
                  return;
  
              var viewModel = viewModelLoader();
              viewModel.RegisterView(view);
              view.ViewModel = (TViewModel)viewModel;
          }
  </code></pre>
  
  <p>I suspect that this is because I am trying to load the views drirectly rather than via a ViewModel. The code in my TabHost Activity looks like:</p>
  
  <pre><code>[Activity(Label = "TabHost")]
      public class TabHostView : MvxBindingTabActivityView&lt;TabHostViewModel&gt;
      {
          protected override void OnViewModelSet()
          {
              SetContentView(Resource.Layout.Page_TabHostView);
              var tabHostWidget = this.TabHost;
  
              TabHost.TabSpec spec;     // Resusable TabSpec for each tab
              Intent intent;            // Reusable Intent for each tab
              // Create an Intent to launch an Activity for the tab (to be reused)
              intent = new Intent(this, typeof(HomeView));
              intent.AddFlags(ActivityFlags.NewTask);
  
              // Initialize a TabSpec for each tab and add it to the TabHost
              spec = tabHostWidget.NewTabSpec("home");
              spec.SetIndicator("Home", Resources.GetDrawable(Resource.Drawable.icon_home));
              spec.SetContent(intent);
              tabHostWidget.AddTab(spec);
  //... more tabs
  </code></pre>
  
  <p>How would I get around this problem?</p>
  
  <p>Also my ViewModels are set up so that the TabHostViewModel has a property for each tab page ViewModel. These are lazy in that they only get the data from the Model when the get accessor for the property is called.</p>
  
  <p>So if I have data binding in my tab page axml layouts, presumably the path has to assume that the TabHostViewModel is the Context (root)? </p>
  
  <p>Many thanks,
  Jason</p>