title: Passing data between view in xamarin forms using mvvm
body: <p>I'm trying to navigate between pages and bind data at same time. </p>
  
  <p>This is what I have tried : </p>
  
  <pre><code>public ICommand GetIdeasCommand
  {
      get
      {
          return new Command(async () =&gt;
          {
              Ideas = await _apiServices.GetIdeasAsync();
              await Application.Current.MainPage.Navigation.PushAsync(new IdeasSinglePage(Ideas));
          });
      }
  }
  </code></pre>
  
  <p>It is supposed the Ideas is a list of arrays I get from the json. But this approach is not helping me since I get a blank page. Also if I call this function inside the page everything is fine. 
  This post gave me an idea : <a href="https://stackoverflow.com/questions/28278506/how-to-pass-a-parameter-from-one-page-to-another-page-in-xamarin-forms">How to pass a parameter from one Page to another Page in Xamarin.Forms?</a> </p>
  
  <p>My view :</p>
  
  <pre><code>&lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
           x:Class="Ideas.Pages.IdeasSinglePage"
           xmlns:vm="clr-namespace:Ideas.ViewModel;assembly=Ideas"
            Title="My Page"&gt;
  
  &lt;ContentPage.BindingContext&gt;
      &lt;vm:IdeasViewModel/&gt;
  &lt;/ContentPage.BindingContext&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>        &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;ViewCell&gt;
                      &lt;StackLayout Padding="20, 10"&gt;
                          &lt;Label Text="{Binding Ideas}"
                                 FontSize="12"
                                 TextColor="RoyalBlue"/&gt;
                      &lt;/StackLayout&gt;
                  &lt;/ViewCell&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>Code behind :</p>
  
  <pre><code>public partial class IdeasSinglePage : ContentPage
  {
      public IdeasSinglePage(List&lt;Models.Ideas&gt; ideas)
      {
  
        InitializeComponent();
        this.BindingContext = new IdeasSinglePage(ideas); //the app breaks here
      }
  }
  </code></pre>
  
  <p>Thanks.</p>