title: Set BindingContext to ViewModel in XAML on Xamarin.Forms
body: <p>I want to develop a simple project with Xamarin.Form and MVVM. In my solution (named XamarinPOC) i have (in addition to standard Xamarin.Forms projects) one separate project for the model (XamarinPOC.Model) and one separate project for the ViewModel (XamarinPOC.ViewModel).</p>
  
  <p>I defined in a XamarinPOC.ViewModel project an abstract class for a BaseViewModel class (that implements the INotifyPropertyChanged Interface) and after I've created a SummaryViewModel class that extend BaseViewModel class with a simple property:</p>
  
  <pre><code>namespace XamarinPOC.ViewModel
  {
      public class SummaryViewModel : BaseViewModel
      {
  
          private string _test = "The binding is OK!";
          public String test
          {
              get
              {
                  return _test;
              }
              set
              {
                  _test = value;
                  OnPropertyChanged("test");
              }
          }
          public SummaryViewModel(){}
      }
  }
  </code></pre>
  
  <p>Next I created a simple ContentPage (SummatyView) in a XamarinPOC project that contain only a label that i want show the text defined in ViewModel. I want to use a XAML for defining the View and the binding but when I run the app nothing is displayed, I no errors on compile-time and runtime but the text are not displayed. My XAML is this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
               xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
               xmlns:local="clr-namespace:XamarinPOC.ViewModel,assembly=XamarinPOC.ViewModel"
               x:Class="XamarinPOC.Summary"
               Title="Summary List"
               BindingContext="XamarinPOC.ViewModel.SummaryViewModel"&gt;
    &lt;StackLayout&gt;
      &lt;Label Text="{Binding test}"/&gt;
    &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>and finally my app.cs is:</p>
  
  <pre><code> namespace XamarinPOC
  {
       public class App : Application
       {
           public App()
           {
               MainPage = new Summary();
           }
       }
   }
  </code></pre>
  
  <p>In the XamarinPOC project I've added a reference to XamarinPOC.ViewModel and XamarinPOC.Model assemblies.</p>
  
  <p>I think the problem is in the XAML definition of binding, but i don't find the error. Where am I wrong?</p>