Avalonia Field Guide
StartAbout

Start here

Build the app, don't just read it

The course is a sequence of small builds. You keep one project, add one view per lesson, and compare behaviour with the expected result before moving on.

What you need

  • .NET 10 SDK — check with dotnet --version
  • An editor (Rider, VS Code with the C# extension, or anything with a terminal)
  • Linux, macOS, or Windows with a desktop session

1. Get the starter

Download starter.zip

unzip starter.zip -d ~/FieldGuide
cd ~/FieldGuide
dotnet run

The starter is the same shell the sample app uses: the application lifetime, light/dark tokens, typography, and one ContentControl named Host. It deliberately contains no lessons. You add them.

2. The loop

  1. Read the lesson's Goal.
  2. Follow Build it; put the new view under Lessons/ and show it from MainWindow.
  3. Run it and walk the Check yourself list.
  4. Mark the lesson complete and continue.

3. Compare when you're stuck

Every lesson has a zip of its expected files. Unzip it and diff:

unzip lesson-lists.zip -d /tmp/expected
diff -ru ~/FieldGuide/Lessons/04_Lists /tmp/expected/Lessons/04_Lists

Compare behaviour first, then code. Formatting differences do not matter. A missing property notification or a command that stays enabled does.

Prefer your own project?

Any Avalonia 12 project works. Use the same packages as the starter, and copy Theme/Tokens.axaml and Theme/Styles.axaml so the pages look like the screenshots. The lesson code uses the CourseApp namespace; rename it if you like, as long as every x:Class matches.

If the window doesn't appear

  • Linux: confirm DISPLAY (X11) or WAYLAND_DISPLAY (Wayland) is set in the same shell.
  • Run dotnet build separately to read compiler output.
  • A failed restore names the feed; try again before clearing caches.

Start lesson 01