Created
January 9, 2018 18:49
ContentPage с несколькими элементами UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment