title: Xamarin.Forms accessing controls written in markup from Code
body: <p>Im trying to add some items to a  Listview which i added using Xamarin.Forms markup  in an xaml file.
  The button can be accessed by hooking with the click event.But since the listview is empty i need the event like <code>ondraw</code> like in winforms, so that i can hook to it when it is drawn. </p>
  
  <p><img src="https://i.stack.imgur.com/vSnfX.png" alt="enter image description here"></p>
  
  <p>In the XAML file I have :</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="ButtonXaml.ButtonXamlPage"&gt;
               &lt;StackLayout&gt;
    &lt;Button Text="Tap for click count!"
      BorderWidth="10"
      TextColor="Red"
      HorizontalOptions="Center"
            Clicked="OnButtonClicked" /&gt;
            &lt;ListView 
            HorizontalOptions="Center"
  
            /&gt;
  
     &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>In the .cs file i have </p>
  
  <pre><code>using System;
  using Xamarin.Forms;
  
  namespace ButtonXaml
  {
      public partial class ButtonXamlPage
      {
          int count = 0;
  
          public ButtonXamlPage()
          {
              InitializeComponent();
          }
  
          public void OnButtonClicked(object sender, EventArgs args)
          {
              ((Button)sender).Text = "You clicked me";
          }
      }
  }
  </code></pre>
  
  <p>So should i hook to events in Listview or can i do something like <code>Resource.getElementbyID</code> like we do in android</p>