title: I need to navigate from one page to an another page on xamarin.Forms.app
body: <p>Because I'm new to Xamarin, I really have no idea how to switch between pages. so I refer to internet and found some solution. But there are some errors.Can anyone help to sort out this issue? Here's my code in app.cs file.I put comments to the codes that I'm not sure. When I click the btn1, that triggered an error called &quot;pushAsync is not supported globally on iOS&quot;.</p>
  <pre class="lang-cs prettyprint-override"><code>using System;
  using Xamarin.Forms;
  
  namespace mine
  {
      public class App : Application
      {
      public App ()
          {
  
              // The root page of your application
  
  
              Button btn1 = new Button();
              Button btn2 = new Button();
              Button btn3 = new Button();
              btn1.Text= &quot;Farmer&quot;;
              btn2.Text= &quot;Advisor&quot;;
              btn3.Text= &quot;Supplier&quot;;
  
              MainPage = new ContentPage {
                  Content = new StackLayout {
                      VerticalOptions = LayoutOptions.Center,
                      Children = {
                          new Label {
                              XAlign = TextAlignment.Center,
                              Text = &quot;Welcome to Rice Growing Advisor!&quot;
                                  //App.Navigation.PushAsync(new MyCustomContentPage());
                                  //App.Navigation.PushAsync (new MainPage ());
                          }, btn1,btn2,btn3
                      }
                  }
  
              
  
              };
              //var np = new NavigationPage(new MainPage());
              //MainPage=np;
              //MainPage = new NavigationPage (MainPage);
              //var rootPage = new NavigationPage(MainPage);
  
  
  
              btn1.Clicked += async (sender, e) =&gt; {
                  //MainPage= new NavigationPage(new MainPage());
                  //MainPage = np;
  
                  await MainPage.Navigation.PushAsync(new NavigationPage());
                  MainPage.Navigation.RemovePage(MainPage);
                  
                  
  
  
              };
  
          }
  
          protected override void OnStart ()
          {
              // Handle when your app starts
          }
  
          protected override void OnSleep ()
          {
              // Handle when your app sleeps
          }
  
          protected override void OnResume ()
          {
              // Handle when your app resumes
          }
      }
  }
  </code></pre>