Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainPage:
- ```
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:TripWithStrangers"
- x:Class="App.MainPage">
- <StackLayout Margin="10,20,10,20">
- <Label Text="Welcome!"
- HorizontalOptions="Center"
- FontSize="20"/>
- <Label Margin="10,30,10,5"
- Text="Username: "
- FontSize="15"/>
- <Entry/>
- <Label Margin="10,5,10,5"
- Text="Password: "
- FontSize="15"
- x:Name="passwordLabel"/>
- <Entry IsPassword="True"/>
- <Button Text="Login!"
- FontSize="15"
- x:Name="loginButton"
- Clicked="loginButton_Clicked"/>
- <Button Margin="0,0,0,0"
- Text="New here?"
- x:Name="register"
- Clicked="register_Clicked"/>
- </StackLayout>
- </ContentPage>
- ```
- namespace App
- {
- public partial class MainPage : ContentPage
- {
- public MainPage()
- {
- InitializeComponent();
- }
- private void loginButton_Clicked(object sender, EventArgs e)
- {
- }
- private void register_Clicked(object sender, EventArgs e)
- {
- Navigation.PushAsync(new RegisterPage());
- }
- }
- }
- RegisterPage
- ```
- <?xml version="1.0" encoding="utf-8" ?>
- <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
- xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
- xmlns:local="clr-namespace:TripWithStrangers"
- x:Class="App.RegisterPage">
- <StackLayout Margin="10,20,10,20">
- <Label Text="Register Page!"
- HorizontalOptions="Center"
- FontSize="20"/>
- <Label Margin="10,30,10,5"
- Text="Username: "
- FontSize="15"/>
- <Entry/>
- <Label Margin="10,30,10,5"
- Text="Email: "
- FontSize="15"/>
- <Entry/>
- <Label Margin="10,5,10,5"
- Text="Password: "
- FontSize="15"/>
- <Entry IsPassword="True"/>
- <Label Margin="10,5,10,5"
- Text="Reenter Password: "
- FontSize="15"/>
- <Entry IsPassword="True"/>
- <Button Text="Register!"
- FontSize="15"/>
- </StackLayout>
- </ContentPage>
- ```
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace App
- {
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class RegisterPage : ContentPage
- {
- public RegisterPage ()
- {
- InitializeComponent ();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement