Book Image

.NET MAUI for C# Developers

By : Jesse Liberty, Rodrigo Juarez
3.7 (6)
Book Image

.NET MAUI for C# Developers

3.7 (6)
By: Jesse Liberty, Rodrigo Juarez

Overview of this book

While UI plays a pivotal role in retaining users in a highly competitive landscape, maintaining the same UI can be tricky if you use different languages for different platforms, leading to mismatches and un-synced pages. In this book, you'll see how .NET MAUI allows you to create a real-world application that will run natively on different platforms. By building on your C# experience, you’ll further learn to create beautiful and engaging UI using XAML, architect a solid app, and discover best practices for this Microsoft platform. The book starts with the fundamentals and quickly moves on to intermediate and advanced topics on laying out your pages, navigating between them, and adding controls to gather and display data. You’ll explore the key architectural pattern of Model-View-ViewModel: and ways to leverage it. You’ll also use xUnit and NSubstitute to create robust and reliable code. By the end of this book, you’ll be well-equipped to leverage .NET MAUI and create an API for your app to interact with a web frontend to the backend data using C#.
Table of Contents (18 chapters)
1
Part 1 – Getting Started
8
Part 2 – Intermediate Topics
12
Part 3 – Advanced Topics

What this book covers

Chapter 1, Assembling Your Tools and Creating Your First App, shows you how to download the (free) software you need and will teach you how to create an “out-of-the-box” app to see what is provided to get you started.

Chapter 2, What We Will Build – Forget Me Not, introduces our non-trivial, real-world app – “Forget Me Not.” We’ll go over what it does and then we’ll walk through the various pages to see the entire completed project that we’ll be working on for the rest of the book.

Chapter 3, XAML and Fluent C#, explores the markup language used to create the UI of a .NET MAUI app. We’ll also examine how you can write the UI in C# if you prefer.

Chapter 4, MVVM and Controls, examines the most popular and powerful architecture for building .NET MAUI apps – Model-View-ViewModel (MVVM). We’ll also take a look at many of the core controls used to create the UI.

Chapter 5, Advanced Controls, builds on the previous chapter, adding more advanced controls to create a more powerful and robust UI.

Chapter 6, Layout, focuses on the techniques to arrange the controls on your view and create a professional appearance.

Chapter 7, Understanding Navigation, shows how you move from one page to another and how you can pass along data as you navigate. No serious .NET MAUI app has only one page.

Chapter 8, Storing and Retrieving Data, explores the two ways to persist data. The first is useful for storing a user’s preferences for the program. The second involves building a relational database using SQLite.

Chapter 9, Unit Testing, shows how to use xUnit and the mocking tool nSubstitute to create powerful unit tests. No .NET MAUI program is complete without an extensive suite of unit tests to ensure a program is working correctly.

Chapter 10, Consuming REST Services, explores how to validate a user’s login and obtain their data from Azure. Many modern apps get their data from the cloud, and the most popular way to do so is by using REST services.

Chapter 11, Exploring Advanced Topics, moves into expert techniques, such as managing visual states, using behaviors and triggers, and selecting data templates at run time.