title: Create button with click event Xamarin Android
body: <p>I have the following item.xml -</p>
  
  <pre><code>&lt;LinearLayout
  android:orientation="vertical"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"&gt;
    &lt;TextView
        android:id="@+id/txtTitle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" /&gt;
  
    &lt;Button
        android:id="@+id/[id required here for click event.]"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Using this layout template I am creating multiple items in the code behind -</p>
  
  <pre><code>    public Item(string title, Button btn)
      {
          Text = title;
          Button = btn;
      }
  
      public override View GetView(int position, View convertView)
      {
          var item = Items[position];
          var view = convertView;
  
          var contentItem = (Item)item;
          view = _inflater.Inflate(Resource.Layout.ListViewContentItem, null);
  
          var title = view.FindViewById&lt;TextView&gt;(Resource.Id.txtTitle);
          var btn = view.FindViewById&lt;Button&gt;([button id??]);
  
          title.Text = contentItem.Text;
          btn = contentItem.Button;
  
          return view;
      }
  </code></pre>
  
  <p>My understanding is that id's have to be unique, so how can I create buttons  with unique id's so that I can access their click events?</p>
  
  <p>My code would have to be able to handle the creation of multiple Items each with their own buttons.</p>