title: Xamarin Android Data-Binding with MVVM Light
body: <h1> Original Question:</h1>
  
  <p>I have a problem trying to bind a value from my ViewModel to a TextView in Xamarin Android using MVVM Light. The value changes once and then stops working. even though the object changes in the ViewModel and the binding mode is set to the default (OneWay).</p>
  
  <p>Due to business requirements i am required to keep using MVVM Light and Xamarin Android.</p>
  
  <p>Example:<br />
  In my first fragment I have a list of books that is bound to a list of books in my ViewModel. In my Viewmodel i have an object named CurrentBook which changes with an onclick event in my list.</p>
  
  <pre><code>VM.CurrentBook = Books[index];
  </code></pre>
  
  <p>In my second fragment i have the title bound to a TextView </p>
  
  <pre><code>_titleBinding = this.SetBinding(() =&gt; VM.CurrentBook.Title, () =&gt; TitleTextView.Text);
  </code></pre>
  
  <p>The first time the Current book changes from <strong>NULL</strong> to an instance of <strong>Book</strong> the title changes as desired. After the first time when changing <strong>VM.CurrentBook = Books[index];</strong> the title remains the same as the first seleced book.</p>
  
  <hr>
  
  <h1> Update: </h1>
  
  <p>I have tried a couple of things with the help of <em>Milen Pavlov</em>,
  I tried changing to </p>
  
  <pre><code>VM.SetBinding(() =&gt; VM.CurrentBook.Title, TitleTextView, () =&gt; TitleTextView.Text, BindingMode.TwoWay);
  </code></pre>
  
  <p>This triggerd an error:</p>
  
  <pre><code>System.Reflection.TargetException: Object of type '[Solution].Client.Shared.ViewModels.BooksViewModel' doesn't match target type '[Solution].Client.Android.BookDetailsFragment'
  </code></pre>
  
  <p><br /> <br />Another thing i tried:</p>
  
  <pre><code>_titleBinding = this.SetBinding(() =&gt; VM.CurrentBook.Title, TitleTextView, () =&gt; TitleTextView.Text, BindingMode.TwoWay);
  enter code here
  </code></pre>
  
  <p>This triggerd another error:</p>
  
  <pre><code>System.Reflection.TargetException: Object of type 'Android.Support.V7.Widget.AppCompatTextView' doesn't match target type '[solution].Client.Android.BookDetailsFragment'
  </code></pre>