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 XAML. If you do this, however, you’ll find it difficult to read other people’s code, as most existing Xamarin.Forms
(the precursor to .NET MAUI) apps are written with XAML.
Using C# can assist in those...