XAML syntax
Since XAML is an XML-based language, to understand it better, we need to understand basic XML syntax first. In an XML file, it starts with an XML declaration or prolog. The content of XML or XAML files includes a hierarchy of elements. Each element may have attributes associated with it.
Let’s review App.xaml
in the project that we created in Chapter 2, Building Our First .NET MAUI App, as an example:
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:PassXYZ.Vault"
x:Class="PassXYZ.Vault.App">
<Application.Resources>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="…/Colors.xaml" />
<ResourceDictionary Source="…/Styles.xaml" />
...