title: Do we have to write OnItemTapped method in xml code behind page or ViewModel Page ? and How?
body: <p>i am trying to add below method in my ViewModel class but showing the error like method not found in code behind page so question is do i have to write the below method in xml code behind page or in viewmodel file , i want to follow MVVM Pattern </p>
  
  <p><strong>ViewModel Page :</strong> </p>
  
  <pre><code>public class StationPickerViewModel : ContentPage
      {
        //  private List&lt;StationDetails&gt; _stationDetails;
  
          public List&lt;StationDetails&gt; Stations
          {
              get
              {
                return  new List&lt;StationDetails&gt;() {
                      new StationDetails{ Id = 1, StationCode=01, StationFullName="vapi", StationShortName="vp", TrainId=1},
                      new StationDetails{ Id = 2, StationCode=02, StationFullName="KaramBele", StationShortName="kmb", TrainId=2},
                      new StationDetails{ Id = 3, StationCode=03, StationFullName="Bhilad", StationShortName="bh", TrainId=3},
                      new StationDetails{ Id = 4, StationCode=04, StationFullName="Sanjan", StationShortName="sn", TrainId=4},
                      new StationDetails{ Id = 5, StationCode=05, StationFullName="Umargam", StationShortName="um", TrainId=5}
              };
              }
          }
  
          public void OnItemTapped(object o, ItemTappedEventArgs e)
          {
              var station = e.Item as StationDetails;
              DisplayAlert("Selection Mode", "You Tapped On" + station.StationFullName, "OK");
          }
      }
  </code></pre>
  
  <p><strong>xml Page Code :</strong> </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="RailwayIndicator.View.StationPickerPage"&gt;
          &lt;ContentPage.Content&gt;
              &lt;StackLayout Padding="20"&gt;
                  &lt;Label FontSize="Large"&gt;Choose the Starting Station&lt;/Label&gt;
                  &lt;ListView x:Name="StationList" 
                            ItemsSource="Binding Stations"
                            ItemTapped="OnItemTapped"&gt;
                      &lt;ListView.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;ViewCell&gt;
                                  &lt;StackLayout&gt;
                                      &lt;Label Text="Binding StationFullName" Font="12" BackgroundColor="Brown"/&gt;
                                  &lt;/StackLayout&gt;
                              &lt;/ViewCell&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ListView.ItemTemplate&gt;
                  &lt;/ListView&gt;
  
              &lt;/StackLayout&gt;
          &lt;/ContentPage.Content&gt;
      &lt;/ContentPage&gt;
  </code></pre>
  
  <p><strong>xml page code behind :</strong> </p>
  
  <pre><code>namespace RailwayIndicator.View
  {
      [XamlCompilation(XamlCompilationOptions.Compile)]
      public partial class StationPickerPage : ContentPage
      {
          public StationPickerPage ()
          {
              InitializeComponent ();
          }
      }
  }
  </code></pre>