.NET MAUI Fundamentals: Building Cross-Platform Applications with .NET 11

.NET MAUI Fundamentals: Building Cross-Platform Applications with .NET 11

13+

Build the Inventory app with .NET MAUI and .NET 11: XAML, MVVM, navigation, SQLite, networking, tests, and device features.

0 followers
28 chapters
Software & AI Development
2026
You're viewing a limited preview. Create a free account to read free books or get Premium to unlock the entire library.

About This Book

You will build and inspect a small inventory application for Android, iOS, Mac Catalyst and Windows. Start with its native application structure, then work through layout, data binding, MVVM, navigation, local persistence, networking, tests and device features. The final chapters cover accessibility, performance and release preparation. Each step has a result you can check, and most chapters add a failure path worth trying.

Who this book is for

You are new to cross-platform application development and already know basic C# classes, interfaces, collections and async/await. You do not need Xamarin experience. If an async method or interface is unfamiliar, review that C# concept before continuing; the book explains how MAUI uses it rather than teaching the C# language from the beginning.

The app you build

You build one app, Inventory, from Chapter 1 to Chapter 16. Chapter 1 starts it with a single Practice page. Chapter 3 adds a product list and a detail page, and each later chapter adds the next feature: layout, data binding, view models, navigation, a SQLite database, networking, tests, custom controls, device features, sign-in, localization, performance work and release preparation.

The app has three projects. Inventory.App holds the pages and the code for each platform. Inventory.Core, added in Chapter 3, holds the models, repositories and view models that don't depend on a screen. Inventory.Tests, added in Chapter 10, tests Inventory.Core on your computer without a device. The sample catalog always starts with the same three products, and the sample web service runs inside the app, so you need no server or account.

Download the companion code free at unqbd.com/go/maui2-code; folder names such as Samples/Checkpoints refer to that download. Samples/Checkpoints/ChapterNN holds the app as it stands at the end of chapter N: the previous checkpoint plus that chapter's changes. Each checkpoint builds and runs on its own and installs as a separate app named "Inventory chapter N", with its own saved data. Samples/Inventory.App is the finished app: Chapter 16's checkpoint plus the solutions to every Activity. Each chapter's Activity also has its own project, Activities/ChapterNN/ActivityNN.csproj, which opens that exercise directly; in the app, Practice > Open chapter activities opens the same pages. The activity index, Activities/README.md, lists each solution and its checks. Full Example sections print each chapter's main new or changed files and link each one to its complete source; the checkpoint holds every other file.

Release baseline

The samples use the .NET 11 SDK, version 11.0.100 or later, with the .NET MAUI workload; the installed workload supplies the matching MAUI Controls version. Samples/global.json selects the SDK and accepts later .NET 11 feature bands. Chapter 2 distinguishes those versions from native tools, and each chapter lists its primary references.

Use Microsoft's .NET 11 tooling guidance, including Visual Studio 2026 or Visual Studio Code with the .NET MAUI extension. Visual Studio for Mac has been retired. Apple targets require a suitable Mac and Xcode 27. Each platform also needs its own native tools; Chapter 2 sets up Android, Apple and Windows.

How to work through a chapter

Each chapter starts where the previous one ended. Keep your own copy of the app inside the Samples folder, so it uses the same SDK and build settings as the checkpoints: Chapter 2 shows how to copy Checkpoints/Chapter01 to Samples/MyInventory. In each chapter, make every step's change in MyInventory and run it. On Windows the steps use Visual Studio; Chapter 2 also gives the Visual Studio Code and terminal way, and each dotnet run --project line in this book is the terminal way to run what Visual Studio runs when you open that folder's Inventory.slnx and press F5. Run each Activity with its printed dotnet run command, or open its completed Activity solution in Visual Studio. If your version misbehaves, compare it with that chapter's checkpoint, or copy the checkpoint again and continue from there. Do each Activity in a separate copy, so your main project stays the same as the checkpoints. Type each command on one line. In a code listing, a long line may continue on the next printed line. Type it as one line, or copy it from the linked source file.

Each step ends with what you should see. Check that result, then try the chapter's invalid, canceled or failed path where it has one. A passing test covers only its own logic; a native build, a launch, a device interaction, a signed package and a store approval are each separate results.

Boundaries of the exercises

The checkout activity uses fictional local data and never charges or submits a real order. The offline queue uses a controlled transport and never writes to an external API. Real identity acquisition requires your own public-client registration and native callback setup; placeholders fail before a browser opens. This sample has no real MSAL adapter for Mac Catalyst; that target uses the controlled renewal exercise instead. Do not put service secrets in a native package.

Android/iOS/Mac hardware, assistive technology, native packaging, signing and store submission need their own testing. Recheck each new SDK and workload release before you ship.

Enjoying this book?

Create a free account to leave comments, track your progress, and more!

Read and listen on the go with the unQbd app. Get the app
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.