1. Welcome to Avalonia and MVVM

Goal

Why this matters

Avalonia in simple words

A short history, governance, and roadmap

How Avalonia is layered

Create your own architecture sketch showing Avalonia.Base at the foundation, Avalonia.Controls and Avalonia.Markup.Xaml layered above it, theme assemblies such as Avalonia.Themes.Fluent, and platform backends surrounding the stack. Keep the diagram handy as you read later chapters.

C#, XAML, and MVVM--who does what

MVVM building blocks you should recognise early

The MVVM contract inside Avalonia

Data context flow across trees

From AppBuilder.Configure to the first window (annotated flow)

  1. Program entry point creates a builder: BuildAvaloniaApp() returns AppBuilder.Configure<App>().
  2. Platform detection (UsePlatformDetect) selects the right backend (Win32, macOS, X11, Android, iOS, Browser).
  3. Rendering setup (UseSkia) chooses the rendering pipeline--Skia by default.
  4. Logging and services (LogToTrace, custom DI) configure diagnostics.
  5. Start a lifetime: StartWithClassicDesktopLifetime(args) (desktop) or StartWithSingleViewLifetime (mobile/browser). Lifetimes live under ApplicationLifetimes.
  6. Application initialises: App.OnFrameworkInitializationCompleted is called; this is where you typically create and show the first Window or set MainView.
  7. XAML loads: AvaloniaXamlLoader reads App.axaml and your window/user control XAML.
  8. Bindings connect: when the window's data context is set to a ViewModel, bindings listen for PropertyChanged events and keep UI and data in sync.

Tour the ControlCatalog (your guided sample)

Why Avalonia instead of...

Repository landmarks (bookmark these)

Check yourself

Practice and validation

What's next