How to make a form and get values in c# method – xamarin

Create a method in your MainPage.xaml.cs

private void submit_Clicked(object sender, EventArgs e)
        {
            var f_name = First_Name.Text;
            var l_name = Last_Name.Text;
            var email = Email.Text;
            
        }

And make the form in your layout , MainPage.xaml

<StackLayout VerticalOptions="CenterAndExpand" Padding="5">
        <StackLayout Orientation="Horizontal">
            <Entry x:Name="First_Name" Placeholder="First Name"></Entry>
            <Entry x:Name="Last_Name" Placeholder="Last Name"></Entry>
        </StackLayout>
        <Entry x:Name="Email" Placeholder="Email"></Entry>
        
        <Button Text="Sign Up" Clicked="submit_Clicked"></Button>
        <Label Text="Already have account? Sign In" TextColor="Blue"></Label>
    </StackLayout>