Advertisement
Guest User

Untitled

a guest
Nov 6th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. MainPage:
  2. ```
  3. <?xml version="1.0" encoding="utf-8" ?>
  4. <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
  5. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  6. xmlns:local="clr-namespace:TripWithStrangers"
  7. x:Class="App.MainPage">
  8.  
  9.  
  10. <StackLayout Margin="10,20,10,20">
  11. <Label Text="Welcome!"
  12. HorizontalOptions="Center"
  13. FontSize="20"/>
  14. <Label Margin="10,30,10,5"
  15. Text="Username: "
  16. FontSize="15"/>
  17. <Entry/>
  18. <Label Margin="10,5,10,5"
  19. Text="Password: "
  20. FontSize="15"
  21. x:Name="passwordLabel"/>
  22. <Entry IsPassword="True"/>
  23. <Button Text="Login!"
  24. FontSize="15"
  25. x:Name="loginButton"
  26. Clicked="loginButton_Clicked"/>
  27. <Button Margin="0,0,0,0"
  28. Text="New here?"
  29. x:Name="register"
  30. Clicked="register_Clicked"/>
  31. </StackLayout>
  32. </ContentPage>
  33. ```
  34. namespace App
  35. {
  36. public partial class MainPage : ContentPage
  37. {
  38. public MainPage()
  39. {
  40. InitializeComponent();
  41. }
  42.  
  43. private void loginButton_Clicked(object sender, EventArgs e)
  44. {
  45.  
  46. }
  47.  
  48. private void register_Clicked(object sender, EventArgs e)
  49. {
  50. Navigation.PushAsync(new RegisterPage());
  51. }
  52. }
  53. }
  54.  
  55. RegisterPage
  56. ```
  57. <?xml version="1.0" encoding="utf-8" ?>
  58. <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
  59. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  60. xmlns:local="clr-namespace:TripWithStrangers"
  61. x:Class="App.RegisterPage">
  62.  
  63.  
  64. <StackLayout Margin="10,20,10,20">
  65. <Label Text="Register Page!"
  66. HorizontalOptions="Center"
  67. FontSize="20"/>
  68. <Label Margin="10,30,10,5"
  69. Text="Username: "
  70. FontSize="15"/>
  71. <Entry/>
  72. <Label Margin="10,30,10,5"
  73. Text="Email: "
  74. FontSize="15"/>
  75. <Entry/>
  76. <Label Margin="10,5,10,5"
  77. Text="Password: "
  78. FontSize="15"/>
  79. <Entry IsPassword="True"/>
  80. <Label Margin="10,5,10,5"
  81. Text="Reenter Password: "
  82. FontSize="15"/>
  83. <Entry IsPassword="True"/>
  84. <Button Text="Register!"
  85. FontSize="15"/>
  86. </StackLayout>
  87. </ContentPage>
  88. ```
  89.  
  90. using Xamarin.Forms;
  91. using Xamarin.Forms.Xaml;
  92.  
  93. namespace App
  94. {
  95. [XamlCompilation(XamlCompilationOptions.Compile)]
  96. public partial class RegisterPage : ContentPage
  97. {
  98. public RegisterPage ()
  99. {
  100. InitializeComponent ();
  101. }
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement