title: Xamarin.forms pass in a variable to a tap gesture when triggered using behind code
body: <p>I have a for loop which would loop out each view cell individual in xaml.cs. I added a tap gesture to the label but i need to differentiate the different label clicked by passing in the FilterName.</p>
  
  <p>Below is my code for looping out the cells in the TableView</p>
  
  <pre><code>for (int m = 0; m &lt; filterList.Count; m++) {
                  ViewCell vc = new ViewCell {
                      View = new StackLayout {
                          Orientation = StackOrientation.Horizontal,
                          HorizontalOptions = LayoutOptions.Start,
                          Children = {
                              new Label () {
                                  Text = "   " + filterList[m].filterName,
                                  YAlign = TextAlignment.Center,
                                  GestureRecognizers = {
                                      new TapGestureRecognizer() {
                                          Command = new Command(TapL_Tapped),
                                          CommandParameter = filterList[m].filterName
                                      }
                                  }
                              },
                              new Image () {
                                  Source = FileImageSource.FromFile("check_mark.jpg"),
                                  HorizontalOptions = LayoutOptions.EndAndExpand
                              }
                          }
                      }
                  };
                  tableView.Root [0].Add (vc);
  </code></pre>
  
  <p>How do I pass the filterList[m].filterName to the TapL_Tapped to use it as a string? I tried with the command parameter but i am not sure what it exactly does. I tried to google how to pass in a variable using this method but to no avail, hope someone can guide me? Thank you:)</p>
  
  <p>Below is the tap gesture method:</p>
  
  <pre><code> void TapL_Tapped() {
   //to do events here
   //can i pass in the string here?
   }
  </code></pre>