title: Listview item tapped in xamarin.forms
body: <p>I'm trying to developp an App in Xamarin.Forms and XAML, and I need to capture an event when I  tap on a LV.
  What I want the app to do is change the color of the Cell (or a StackLayout inside the cell) when the user tap on the Item on a list.
  I'm trying to implement the OnItemTapped property on the listview, but nothing happens when I press the Item.
  My code is quite simple:</p>
  
  <p>Model: Product with 2 propeties, name and color. </p>
  
  <pre><code>public class Product: INotifyPropertyChanged
      {
          #region INotifyPropertyChanged implementation
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          #endregion
  
          public Product ()
          {
          }
  
          public string Name { get; set; }
          public bool Buy { get; set; }
          public  Color micolor { get; set; }
  
          //Método para actualizar los cambios
          protected virtual void OnPropertyChanged (string propertyName)
          {
              if (PropertyChanged == null)
                  return;
  
              PropertyChanged (this, new PropertyChangedEventArgs (propertyName));
          }
      }
  </code></pre>
  
  <p>XAML: Only a list with two bindings: the name in a label, and the color in the SL</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" x:Class="pruebalv.MyPage1"&gt;
      &lt;ContentPage.Content&gt;
       &lt;ListView  x:Name="listView"
       ItemTapped="OmItemTapped"
       &gt;
  
              &lt;ListView.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;ViewCell&gt;
                          &lt;StackLayout 
                          Orientation="Vertical"
                          BackgroundColor ="{Binding micolor}"&gt;
                                  &lt;Label Text="{Binding Name}"/&gt;
                          &lt;/StackLayout&gt;
                      &lt;/ViewCell&gt;
                  &lt;/DataTemplate&gt;
              &lt;/ListView.ItemTemplate&gt;
          &lt;/ListView&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>And behind .cs code: I create the products (it is only a sample) and implement the on item tapped. When item tapped, I want to change the color property of the item pressed.</p>
  
  <pre><code>public void OmItemTapped (object o, ItemTappedEventArgs e)
          {
              var dataItem = e.Item as Product;
              dataItem.micolor  = Color.Green;
              dataItem.Name  = "Tapped!!";
  
          }
  </code></pre>
  
  <p>The result that I get when I create a list is that nothing happens when I tap on an item.</p>
  
  <p>Do am I missing something? As I've understood with the tutorials, only with the "itemtapped" roperty of the ListView, and the InotifyProperty... on the products, I'd see the results. Is it correct?
  Thanks!</p>