The Kladde is a Windows program with a NavigationView and pages for contacts and appointments, and the data is hard-coded. As soon as the data comes from a web API, a form has rules, and someone should review a change, the code behind the pages becomes a problem, because you can only try it out with a running window. This lesson separates the logic from the user interface until you can test it with dotnet test, and shows what WinUI 3 does differently along the way.

Where the Kladde stands

The lesson assumes W5.1.1 and W5.1.2: the packaged WinUI 3 project src/Kladde.Desktop with a NavigationView whose Frame shows the pages ContactsPage, ContactDetailPage and AppointmentsPage, with sample data in the code-behind. The web API's response types from K2 are ContactResponse (Id, Name, Email, Company, Tags) and AppointmentResponse (Title, Start, End, ContactIds). Keep your own names and carry the steps over. NewAppointmentPage is new. W2.2.1 builds the same view models for MAUI; this lesson covers what WinUI 3 does differently.