A single control is no use unless it has a container that hosts it. Let's see what an entire page would look like. A fully valid ContentPage object defined in XAML is an XML document. This means that we must start with an XML declaration. After that, we must have one—and only one—root node, as shown:
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MyApp.MainPage">
<StackLayout>
<Label Text="Hello world!" />
</StackLayout>
</ContentPage>
In the preceding example, we defined a ContentPage object that translates into a single view on each platform. In order to make it a valid XAML, we need to specify a default namespace (xmlns="http://xamarin.com/schemas/2014/forms"...