ContentPage is the standard .NET MAUI page for a full-screen app view. It hosts one View through its Content property, making it the usual starting point for building a screen. section 2.3 section 7.1
Build a ContentPage by choosing how to assign its single content view:
- Use XAML by placing a layout or control between the opening and closing ContentPage tags. section 7.1
- Use C# by assigning a View, such as VerticalStackLayout, to Content in the page constructor. section 7.1
- Assign a layout when the screen needs multiple controls; use a single control directly when the page is simple. section 7.1
A simple button page
Declare a ContentPage in XAML and place one Button inside it: <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="AlohaWorld.MainPage"><Button Text="Click me" FontAttributes="Bold" HorizontalOptions="Center" /></ContentPage>. For a larger screen, assign a ScrollView containing a VerticalStackLayout, then place the controls inside the layout.
