title: How to go to another screen from one screen in Xamarin cross-platform?
body: <p>I am new in Xamarin and I want to go to another screen from one screen. I have a button in first screen and I want to open another screen after clicking on that button.
  How can I do this?</p>
  
  <p>Here is the code I have tried so far:</p>
  
  <p><strong>XAML Layout (FirstXAML.xaml)</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="AllControlsDemo.FirstXaml"&gt;
  
  
  
  &lt;StackLayout&gt;
      &lt;Slider x:Name="sldr" 
        VerticalOptions="CenterAndExpand"
              ValueChanged="OnSliderValueChanged" /&gt;
  
  &lt;Label x:Name="lblValue"
         Text="A simple Label"
         Font="Large"
         HorizontalOptions="Center"
         VerticalOptions="CenterAndExpand" /&gt;
  
      &lt;Button x:Name="btnClickme"
           Text="Click Me!"
              HorizontalOptions="Center"
              VerticalOptions="CenterAndExpand"
              Clicked="OnbtnClickme" /&gt;
  
  
      &lt;Button x:Name="btnSecondXaml"
           Text="Second Xaml!"
              HorizontalOptions="Center"
              VerticalOptions="StartAndExpand"
              Clicked="OnbtnSecondXaml" /&gt;
  
    &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p><strong>Code of (FirstXAML.xaml.cs)</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using Xamarin.Forms;
  
  
  namespace AllControlsDemo
  { 
      public partial class FirstXaml : ContentPage
      { 
  
    private Label valueLabel;
    float count = 0.050f;
    private Slider slider;
  
  
  
  public FirstXaml ()
    {
     InitializeComponent ();
     valueLabel = this.FindByName&lt;Label&gt;("lblValue");
     slider = this.FindByName&lt;Slider&gt; ("sldr");
  
    }
  
  
  
  void OnSliderValueChanged(object sender, ValueChangedEventArgs args)
    {
     valueLabel.Text = ((Slider)sender).Value.ToString("F3");
     count = float.Parse(valueLabel.Text);
    }
  
  
  
  void OnbtnClickme(object sender, EventArgs args)
    {
     count += 0.050f;
     slider.Value = count;
    }
  
  
  
  void OnbtnSecondXaml(object sender, EventArgs args)
    {
     // Write code here to move on second Xaml 
  
    }
  
  
  
  }
  }
  </code></pre>