Creating a Layout

Now, we create a basic layouting in Xamarin according to hierarchical shown before.

// MainPage.xaml
<ContentPage.Content>
    <StackLayout
        Padding="20">

        <Label 
            x:Name="message"
            Text="Hi, Alvin!" 
            VerticalOptions="Center" 
            HorizontalOptions="Center" />
        <Button
            Text="Say Goodbye"
            BackgroundColor="Gray"
            Clicked="Goodbye_Clicked"
            TextColor="White" />

    </StackLayout>
</ContentPage.Content>

Take a look at Label name and the Clicked properties on Button.

results matching ""

    No results matching ""