title: Xamarin Error: Can not find the object referenced by
body: <p>I'm having a bit of a problem with Xamarin Data Binding. When binding to an item in a C# class, I get the error seen in the title. I've been trying to bind an element from the table example found <a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/tableview#custom-cells" rel="nofollow noreferrer">here</a>. I tried adding <code>BindingContext = this;</code> to the constructor and to change the line above the class declaration to <code>[DesignTimeVisible(false)]</code> the way it is in the <code>NewItemPage</code> from the Master-Detail template found during the creation of the project, however, it did not help.</p>
  <p>Here is the code:</p>
  <p>XAML:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;ContentPage xmlns=&quot;http://xamarin.com/schemas/2014/forms&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
               xmlns:d=&quot;http://xamarin.com/schemas/2014/forms/design&quot;
               xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
               mc:Ignorable=&quot;d&quot;
               x:Class=&quot;NetworkScanner.Views.TestPage&quot;&gt;
      &lt;TableView&gt;
          &lt;TableRoot&gt;
              &lt;TableSection Title=&quot;Getting Started&quot; BindingContext=&quot;{x:Reference Table}&quot;&gt;
                  &lt;ViewCell&gt;
                      &lt;StackLayout Orientation=&quot;Horizontal&quot;&gt;
                          &lt;Image Source=&quot;bulb.png&quot; /&gt;
                          &lt;Label Text=&quot;left&quot;
                                   TextColor=&quot;#f35e20&quot; /&gt;
                          &lt;Label Text=&quot;right&quot;
                                   HorizontalOptions=&quot;EndAndExpand&quot;
                                   TextColor=&quot;#503026&quot; /&gt;
                      &lt;/StackLayout&gt;
                  &lt;/ViewCell&gt;
              &lt;/TableSection&gt;
          &lt;/TableRoot&gt;
      &lt;/TableView&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  <p>C#:</p>
  <pre>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  using Xamarin.Forms;
  using Xamarin.Forms.Xaml;
  
  namespace NetworkScanner.Views
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      // [DesignTimeVisible(false)]
      public partial class TestPage : ContentPage
      {
          public TableSection Table { get; set; }
          public TestPage()
          {
              InitializeComponent();
              // BindingContext = this;
          }
      }
  }
  </pre>