title: Cannot Bind a Command to a MvvmCross Button
body: <p>I'm trying to create a button that navigates to another page in mvvmCross. The application boots up correctly but when the button is pressed nothing happens.</p>
  <p>I'm using a modified version of the  <a href="https://github.com/MvvmCross/MvvmCross-Samples/tree/master/Babel" rel="nofollow noreferrer">Bable project</a> it has been updated to use mvvmcross 8. As well as trimmed down to only contain what I think is the minimum to move between two View models.</p>
  <p>Here is the currently code:</p>
  <h3>Core class library:</h3>
  <p><strong>FirstViewModel.cs</strong></p>
  <pre><code>using MvvmCross.Commands;
  using MvvmCross.Navigation;
  using MvvmCross.ViewModels;
  
   namespace Babel2.Core.ViewModels {
      public class FirstViewModel : MvxViewModel
      {
          private readonly IMvxNavigationService _navigationService;
          
          public FirstViewModel(IMvxNavigationService navigationService)
          {
              _navigationService = navigationService;
          }
  
          public IMvxCommand GoCommand =&gt; new MvxCommand(() =&gt; _navigationService.Navigate&lt;SecondViewModel&gt;());
  
      } }
  </code></pre>
  <p><strong>SecondViewModel.cs</strong></p>
  <pre><code>using MvvmCross.ViewModels;
  
  namespace Babel2.Core.ViewModels
  {
      public class FirstViewModel : MvxViewModel
      {
          private readonly IMvxNavigationService _navigationService;
          
          public FirstViewModel(IMvxNavigationService navigationService)
          {
              _navigationService = navigationService;
          }
  
          public IMvxCommand GoCommand =&gt; new MvxCommand(() =&gt; _navigationService.Navigate&lt;SecondViewModel&gt;());
  
      }
  }
  </code></pre>
  <p><strong>App.cs</strong></p>
  <pre><code>using MvvmCross.IoC;
  using MvvmCross.ViewModels;
  
  namespace Babel2.Core
  {
      public class App : MvxApplication
      {
          public override void Initialize()
          {
              CreatableTypes()
                  .EndingWith(&quot;Service&quot;)
                  .AsInterfaces()
                  .RegisterAsLazySingleton();
  
              RegisterAppStart&lt;ViewModels.FirstViewModel&gt;();
          }
      }
  }
  </code></pre>
  <h3>Android Progject</h3>
  <p><strong>FirstView.axml</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:local=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
  
      &lt;Button 
              android:layout_height=&quot;wrap_content&quot;
              android:layout_width=&quot;match_parent&quot;
              android:text=&quot;Second Page Go!&quot;
              local:MvxBind=&quot;Click GoCommand&quot; /&gt;    
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>SecondView.axml</strong></p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:local=&quot;http://schemas.android.com/apk/res-auto&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
      
      &lt;TextView
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:textSize=&quot;40dp&quot;
          android:text=&quot;Second View&quot; /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>SplashScreen.axml</strong></p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
      &lt;TextView
          android:layout_width=&quot;fill_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:text=&quot;Loading....&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p><strong>FirstView.cs</strong></p>
  <pre><code>using Android.App;
  using Android.OS;
  using MvvmCross.Platforms.Android.Views;
  
  namespace Babel2.Droid.Views
  {
      [Activity(Label = &quot;View for FirstViewModel&quot;)]
      public class FirstView : MvxActivity
      {
          protected override void OnCreate(Bundle bundle)
          {
              base.OnCreate(bundle);
              SetContentView(Resource.Layout.FirstView);
          }
      }
  }
  </code></pre>
  <p><strong>SecondView.cs</strong></p>
  <pre><code>using Android.OS;
  using Android.Views;
  using MvvmCross.Platforms.Android.Views.Fragments;
  
  namespace Babel2.Droid.Views
  {
      public class SecondView : MvxFragment
      {
          public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          {
              base.OnCreateView(inflater, container, savedInstanceState);
              View view = inflater.Inflate(Resource.Layout.SecondView, container, false);
              return view;
          }
          
      }
  }
  </code></pre>
  <p><strong>LinkerPleaseInclude.cs</strong></p>
  <pre><code>using System.Collections.Specialized;
  using System.Windows.Input;
  using Android.App;
  using Android.Views;
  using Android.Widget;
  using MvvmCross;
  
  namespace Babel2.Droid
  {
      [Preserve(AllMembers = true)]
      public class LinkerPleaseInclude
      {
                  public void Include(Button button)
          {
              button.Click += (s,e) =&gt; button.Text = button.Text + &quot;&quot;;
          }
  
          public void Include(CheckBox checkBox)
          {
              checkBox.CheckedChange += (sender, args) =&gt; checkBox.Checked = !checkBox.Checked;
          }
          
          public void Include(Switch @switch)
          {
              @switch.CheckedChange += (sender, args) =&gt; @switch.Checked = !@switch.Checked;
          }
  
          public void Include(View view)
          {
              view.Click += (s, e) =&gt; view.ContentDescription = view.ContentDescription + &quot;&quot;;
          }
  
          public void Include(TextView text)
          {
              text.TextChanged += (sender, args) =&gt; text.Text = &quot;&quot; + text.Text;
              text.Hint = &quot;&quot; + text.Hint;
          }
          
          public void Include(CheckedTextView text)
          {
              text.TextChanged += (sender, args) =&gt; text.Text = &quot;&quot; + text.Text;
              text.Hint = &quot;&quot; + text.Hint;
          }
  
          public void Include(CompoundButton cb)
          {
              cb.CheckedChange += (sender, args) =&gt; cb.Checked = !cb.Checked;
          }
  
          public void Include(SeekBar sb)
          {
              sb.ProgressChanged += (sender, args) =&gt; sb.Progress = sb.Progress + 1;
          }
  
          public void Include(Activity act)
          {
              act.Title = act.Title + &quot;&quot;;
          }
  
          public void Include(INotifyCollectionChanged changed)
          {
              changed.CollectionChanged += (s,e) =&gt; { var test = $&quot;{e.Action}{e.NewItems}{e.NewStartingIndex}{e.OldItems}{e.OldStartingIndex}&quot;; };
          }
  
          public void Include(ICommand command)
          {
              command.CanExecuteChanged += (s, e) =&gt; { if (command.CanExecute(null)) command.Execute(null); };
          }
          
          // public void Include(MvvmCross.Platform.IoC.MvxPropertyInjector injector)
          // {
          //     injector = new MvvmCross.Platform.IoC.MvxPropertyInjector ();
          // } 
  
          public void Include(System.ComponentModel.INotifyPropertyChanged changed)
          {
              changed.PropertyChanged += (sender, e) =&gt;  {
                  var test = e.PropertyName;
              };
          }
      }
  }
  </code></pre>
  <p><strong>Setup.cs</strong></p>
  <pre><code>using Babel2.Core;
  using Microsoft.Extensions.Logging;
  using MvvmCross.Platforms.Android.Core;
  using Serilog.Extensions.Logging;
  
  namespace Babel2.Droid
  {
      public class Setup : MvxAndroidSetup&lt;App&gt;
      {
          protected override ILoggerProvider CreateLogProvider()
          {
              return new SerilogLoggerProvider();
          }
  
          protected override ILoggerFactory CreateLogFactory()
          {
              return new SerilogLoggerFactory();
          }
      }
  }
  </code></pre>
  <p><strong>SplashScreen.cs</strong></p>
  <pre><code>using Android.App;
  using Android.Content.PM;
  using MvvmCross.Platforms.Android.Views;
  
  namespace Babel2.Droid
  {
      [Activity(
          Label = &quot;Babel2.Droid&quot;
          , MainLauncher = true
          , Icon = &quot;@drawable/icon&quot;
          , Theme = &quot;@style/AppTheme&quot;
          , NoHistory = true
          , ScreenOrientation = ScreenOrientation.Portrait)]
      public class SplashScreen : MvxSplashScreenActivity
      {
          public SplashScreen()
              : base(Resource.Layout.SplashScreen)
          {
          }
      }
  }
  </code></pre>