title: How to get value from XAML after clicking a submit button in Xamarin Forms?
body: <p>I want to retrieve a value from the Entry input after clicking an event. How can I retrieve it. Following is my XAML code:</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"
               xmlns:local="clr-namespace:HelloWorld"
               x:Class="HelloWorld.MainPage"&gt;
  
      &lt;StackLayout Spacing="10" x:Name="layout"&gt;
  
          &lt;Label Text="Name" VerticalOptions="Start" FontSize="Large"/&gt;
  
          &lt;Entry x:Name="name" Placeholder="Enter your name"/&gt;
  
  
          &lt;Label Text="Password" VerticalOptions="Start" FontSize="Large"/&gt;
  
          &lt;Entry x:Name="password" IsPassword="True" Placeholder="****"/&gt;
  
          &lt;Label Text="Date of Birth" VerticalOptions="Start" FontSize="Large"/&gt;
          &lt;DatePicker x:Name="dob"/&gt;
  
          &lt;Label Text="Gender" VerticalOptions="Start" FontSize="Large"/&gt;
  
          &lt;Picker x:Name="GenderPicker" HorizontalOptions="FillAndExpand"&gt;
              &lt;Picker.Items&gt;
                  &lt;x:String&gt;Male&lt;/x:String&gt;
                  &lt;x:String&gt;Female&lt;/x:String&gt;
              &lt;/Picker.Items&gt;
          &lt;/Picker&gt;
  
          &lt;Button x:Name="submit" Text="Save" BorderWidth="20" Clicked="submit_Clicked"/&gt;
  
      &lt;/StackLayout&gt;
  
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>And i want to retrieve the data in a submit_Clicked() method.</p>
  
  <pre><code>      private void submit_Clicked(object sender, EventArgs e)
          {
  how?
          }
  </code></pre>