title: How to implement Recycler View in MvvmCross using MvxRecyclerView
body: <p>In MvvmCross, I have an android listview within an activity that works. </p>
  
  <p>I read somewhere that changing the listView to a recyclerView is as simple as changing MvxListView to MvxRecyclerView in my layout .axml file. Trying that gives me the following runtime exception:</p>
  
  <pre><code>Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class Mvx.MvxRecyclerView
  </code></pre>
  
  <p>Is there anything that I have to do differently in the code behind or view model when using MvxRecyclerView? Below is my code. </p>
  
  <p>Layout files:</p>
  
  <p>Main.axml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:local="http://schemas.android.com/apk/res-auto"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;Mvx.MvxRecyclerView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:scrollbars="vertical"
          android:id="@+id/words_listview"
          local:MvxItemTemplate="@layout/words_listview_row"
          local:MvxBind="ItemsSource Words" /&gt;
  &lt;/LinearLayout&gt; 
  </code></pre>
  
  <p>words_listview_row.axml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:p1="http://schemas.android.com/apk/res/android"
      xmlns:local="http://schemas.android.com/apk/res-auto"
      p1:minWidth="25px"
      p1:minHeight="25px"
      p1:layout_width="match_parent"
      p1:layout_height="match_parent"
      p1:id="@+id/relativeLayout1"
      p1:background="#FFFFFF"&gt;
      &lt;TextView
          p1:text="Word name"
          p1:layout_width="wrap_content"
          p1:layout_height="wrap_content"
          p1:id="@+id/headingTextView"
          p1:width="325dp"
          p1:textColor="#000000"
          p1:layout_alignParentLeft="true"
          p1:textSize="18sp"
          p1:paddingLeft="20dp"
          p1:paddingTop="15dp"
          local:MvxBind="Text Name" /&gt;
      &lt;TextView
          p1:text="Word meaning"
          p1:layout_width="match_parent"
          p1:layout_height="wrap_content"
          p1:layout_below="@id/headingTextView"
          p1:id="@+id/detailTextView"
          p1:textColor="#8f949a"
          p1:layout_alignParentLeft="true"
          p1:textSize="16sp"
          p1:paddingLeft="20dp"
          p1:paddingRight="20dp"
          p1:paddingBottom="15dp"
          local:MvxBind="Text Meaning" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>WordViewModel.cs</p>
  
  <pre><code>using MvvmCross.Core.ViewModels;
  using VocabBuilder.Core.Models;
  using VocabBuilder.Core.Services.Interfaces;
  
  namespace VocabBuilder.Core.ViewModels
  {
      public class WordViewModel : MvxViewModel
      {
          private IWordService _wordService;
  
          public MvxObservableCollection&lt;Word&gt; Words { get; set; }
  
          public WordViewModel(IWordService wordService)
          {
              Words = new MvxObservableCollection&lt;Word&gt;();
  
              _wordService = wordService;
  
              Words.ReplaceWith(_wordService.GetAllWords());
          }
      }
  }
  </code></pre>
  
  <p>Codebehind/ WordView.cs</p>
  
  <pre><code>using Android.App;
  using Android.OS;
  using MvvmCross.Droid.Views;
  using VocabBuilder.Core.ViewModels;
  
  namespace VocabBuilder.UI.Droid.Views
  {
      [Activity(Label="Vocab Builder", MainLauncher=true)]
      public class WordView : MvxActivity&lt;WordViewModel&gt;
      {
          protected override void OnCreate(Bundle bundle)
          {
              base.OnCreate(bundle);
              SetContentView(Resource.Layout.Main);
          }
      }
  }
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>EDIT:</p>
  
  <p>Here is my Setup.cs file:</p>
  
  <pre><code>using Android.Content;
  using MvvmCross.Core.ViewModels;
  using MvvmCross.Droid.Platform;
  
  namespace VocabBuilder.UI.Droid
  {
      public class Setup : MvxAndroidSetup
      {
          public Setup(Context applicationContext) : base(applicationContext)
          {
          }
  
          protected override IMvxApplication CreateApp()
          {
              return new Core.App();
          }
      }
  }
  </code></pre>