title: Passing two parameters in CommandParameter in Xamarin Forms
body: <p>I have defined a model as follows: </p>
  
  <pre><code>public class UserDetails
  {
      public int Id { get; set; }
      public string Username { get; set; }
      public string Password { get; set; }
      public List&lt;Transport&gt; TransportModel { get; set; }
  }
  </code></pre>
  
  <p>Based on the above model, I have instantiated a list that contains hard coded values for testing purposes.</p>
  
  <p>Further, I am dynamically populating buttons based on the TransportModel values on a XAML page as follows: </p>
  
  <pre><code>        StackLayout stack = new StackLayout();
  
          foreach (var t in user.TransportModel)
          {
  // Here I am looping to access data in the TransportModel
              Button btn = new Button();
              btn.Text = t.Name;
              btn.SetBinding(Button.CommandProperty, new Binding("ShowCommandParameter"));
              btn.CommandParameter = user.TransportModel; // if this correct ?
              stack.Children.Add(btn);
          }
  </code></pre>
  
  <p>And I have the following ViewModel: </p>
  
  <pre><code> public TransportViewModel()
          {
              ShowCommandParameter = new Command&lt;UserDetails&gt;(Show);
          }
  
          public void Show(UserDetails param)
          {
          // I want to access properties of TransportModel here..
          }
  </code></pre>
  
  <p>The issue that I am having is that I want to pass two parameters in the <code>CommandParameter</code>. And I want to access these values within the <code>Show</code> method. </p>
  
  <p>Could someone please help me on this ? I'm totally stuck.</p>