Guest User

Untitled

a guest
Jan 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. public App ()
  2. {
  3. // The root page of your application
  4. var layout = new StackLayout
  5. {
  6. VerticalOptions = LayoutOptions.Center,
  7. Children = {
  8. new Label {
  9. HorizontalTextAlignment = TextAlignment.Center,
  10. Text = "Welcome to Xamarin Forms!"
  11. }
  12. }
  13. };
  14.  
  15. MainPage = new ContentPage
  16. {
  17. Content = layout
  18. };
  19.  
  20. Button button = new Button
  21. {
  22. Text = "Click Me"
  23. };
  24.  
  25. button.Clicked += async (s, e) => {
  26. await MainPage.DisplayAlert("Alert", "You clicked me", "OK");
  27. };
  28.  
  29. layout.Children.Add(button);
  30. }
Add Comment
Please, Sign In to add comment