.NET MAUI in the browser
A mobile app is one of the typical practical parts of the Polish INF.04 exam. If you write C#, it usually means .NET MAUI: the page layout in XAML and event handling in C#. In class that means Visual Studio with the MAUI workload and a phone emulator, so a lot of installing and a strong computer. In BitWizards the whole project lives in a browser tab: MainPage.xaml and MainPage.xaml.cs in the editor, and next to them a phone that runs the app as soon as you click Run.
Course: .NET MAUI mobile apps step by step - first lesson (lessons are in Polish)
A page in XAML
The project looks like a new “.NET MAUI App” in Visual Studio: a ContentPage with a title on the bar, the MauiApp1 namespace, a XAML file and a C# file. Supported controls: Label, Button, Entry, Editor, CheckBox, Switch, RadioButton, Slider, Stepper, Picker, DatePicker, TimePicker, ProgressBar, ActivityIndicator, Image, BoxView, CollectionView and ListView; layouts VerticalStackLayout, HorizontalStackLayout, Grid (rows, columns, Auto, *, ColumnSpan), ScrollView, Border and Frame, with margins, spacing and alignment as on a phone.
Code-behind in C#
MainPage.xaml.cs is a real partial page class: a constructor with InitializeComponent(), fields from x:Name and event handlers (Clicked, TextChanged, Completed, CheckedChanged, Toggled, ValueChanged, SelectedIndexChanged). Dialogs work as in MAUI: DisplayAlert with one or two buttons, the DisplayActionSheet sheet and the DisplayPromptAsync text prompt, all awaited in an async void handler. IsVisible and IsEnabled hide and disable controls, TapGestureRecognizer makes frames and labels tappable, and Children.Add(new Label { ... }) adds controls created in code.
Later topics of the course use navigation between pages (Navigation.PushAsync, PopAsync, the Back arrow), data binding (BindingContext, {Binding}, INotifyPropertyChanged, Command), lists with ObservableCollection and DataTemplate, Preferences and files in FileSystem.AppDataDirectory (kept across restarts), the IDispatcherTimer and Task.Delay.
The course
.NET MAUI mobile apps step by step (11 topics, 84 examples and exercises, in Polish) goes from the first page to INF.04-style tasks: labels, buttons and Clicked, text fields and numbers, layouts, choice controls, dialogs, controls created in code, exam-style projects (BMI calculator, account sign-up with validation, currency converter) and apps with several pages (PushAsync, PopAsync, OnAppearing, modal pages) and MVVM (BindingContext, {Binding}, Command with CanExecute) and lists (CollectionView, ListView, ObservableCollection), plus app data and time (Preferences, files, IDispatcherTimer, Task.Delay, DatePicker, TimePicker). Tasks check the XAML controls and tap through the app like a user would.
Limitations
Not included: Shell with a flyout and tabs, App.xaml and MauiProgram.cs (the project only has pages), control templates, animations, maps, camera, sensors, notifications and NuGet controls (e.g. the Community Toolkit). The phone preview resembles Android but is not pixel-identical to any system.
Related pages
INF.04 exam - C# - WPF - Android