A Declarative UI is a modern approach to building an app’s user interface (UI) in code rather than using a separate markup or tooling approach. The .NET MAUI Community Toolkit provides a fluent API called C# Markup, enabling us to create declarative UIs in C# with .NET MAUI.
C# Markup enables the creation of a View using C#, leveraging the fluent API to reduce the code’s verbosity. The views can be used in a traditional MVVM architecture alongside XAML Views.
To demonstrate this, I have refactored only the XAML Views from the previous blog post while keeping the rest of the app the same to allow us to compare the two approaches.