3

XAML and Fluent C#

In this chapter, we will look at how .NET MAUI applications are created using a markup language for the user interface and C# for all the logic.

.NET MAUI programs are (typically) written in two languages. One is C#, which is used for all the logic, and the other is XAML (pronounced zamel, to rhyme with camel), which is used for the layout and creation of controls. As you’ll see, the use of XAML is optional. You can create your layout and controls all in C#, but most people don’t. However, that may be changing (more and more of the Microsoft Learn documentation shows both ways).

When might you choose to use C#?

There are a few reasons to use C# instead of XAML, not least that you know C# and don’t want to bother learning ...

Get .NET MAUI for C# Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.