Skip to content

Instantly share code, notes, and snippets.

@Artgerto
Created January 9, 2018 18:49

Revisions

  1. Artgerto created this gist Jan 9, 2018.
    30 changes: 30 additions & 0 deletions App.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    public App ()
    {
    // The root page of your application
    var layout = new StackLayout
    {
    VerticalOptions = LayoutOptions.Center,
    Children = {
    new Label {
    HorizontalTextAlignment = TextAlignment.Center,
    Text = "Welcome to Xamarin Forms!"
    }
    }
    };

    MainPage = new ContentPage
    {
    Content = layout
    };

    Button button = new Button
    {
    Text = "Click Me"
    };

    button.Clicked += async (s, e) => {
    await MainPage.DisplayAlert("Alert", "You clicked me", "OK");
    };

    layout.Children.Add(button);
    }