title: Xamarin Can't Access Controls on Code Behind
body: <p>For my Xamarin Forms project (latest version 1.3), when I create a view in Xamarin Studio (latest, 5.5.4), I define the view as the following:</p>
  
  <pre class="lang-xml prettyprint-override"><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" x:Class="FormsDemo.Register"&gt;
    &lt;ContentPage.Content&gt;
  
      &lt;Grid&gt;
        &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition /&gt;
          &lt;RowDefinition /&gt;
        &lt;/Grid.RowDefinitions&gt;
        &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="100" /&gt;
          &lt;ColumnDefinition /&gt;
        &lt;/Grid.ColumnDefinitions&gt;
  
        &lt;Label Grid.Row="0" Grid.Column="0" Text="First Name" /&gt;
        &lt;Entry x:Name="FirstName" Grid.Row="0" Grid.Column="1" /&gt;
  
        &lt;Label Grid.Row="1" Grid.Column="0" Text="Last Name" /&gt;
        &lt;Entry x:Name="LastName" Grid.Row="1" Grid.Column="1" /&gt;
  
        &lt;Label Grid.Row="2" Grid.Column="0" Text="Email" /&gt;
        &lt;Entry x:Name="Email" Grid.Row="2" Grid.Column="1" /&gt;
  
        &lt;Button x:Name="SaveButton" Grid.Row="3" Grid.Column="0" Text="Login" /&gt;
      &lt;/Grid&gt;
  
    &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>However, in my code-behind, any references to the control by its name are not being found at all. The following code is erroring (noted by comments):</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System;
  using System.Collections.Generic;
  using Xamarin.Forms;
  
  namespace FormsDemo
  { 
    public partial class Register : ContentPage
    { 
      public Register ()
      {
        InitializeComponent ();
  
              //Using this approach worked, but is not ideal
        this.FindByName&lt;Button&gt;("SaveButton").Clicked += Save_Clicked;
      }
  
      void Save_Clicked (object sender, EventArgs e)
      {
        this.FirstName.Text = "A";
        this.LastName.Text= "B";
      }
    }
  }
  </code></pre>
  
  <p>Oddly enough, I was getting warnings with:</p>
  
  <blockquote>
    <p>Warning: The private field `FormsDemo.Register.FirstName' is assigned but its value is never used (FormsDemo.Solution)</p>
  </blockquote>
  
  <p>I get one for each field.  Why is this not working?  How do I get IntelliSense to work?</p>