Skip to content

High level architecture overview

Max Katz edited this page May 14, 2024 · 7 revisions

Checkout this blog post for up to date details: https://avaloniaui.net/Blog/avalonia-platform-support-why-it-s-simple


Outdated:

The idea is to split portable (core) and platform-specific (subsystem) code into separate assemblies/packages.

diagram

Also see a bit outdated documentation here

We have subsystems for:

Various .NET Runtimes

The approach for scanning assemblies, threading, etc is a bit different for .NETFX/Mono, .NET Core and Xamarin platforms

Rendering

Rendering subsystem should provide an implementation of IDrawingContextImpl and means to obtain one for a surface. Surface might be a Win32 window handle (needed for Direct2D), GDK drawable or a framebuffer abstraction that provides a region of unmanaged memory for rendering. It's planned to add opengl-context based surface to be consumed by Skia backend.

Windowing

While providing various services for handing the event loop, loading cursors and icons, the main task of windowing subsystems is to provide the means to get something on screen. For that we have a concept of TopLevels - controls, that are intended to be a widget hierarchy root that's displayed on screen. toplevels

  • TopLevel class represents a square region of the screen that has some size and can accept user input and provides surfaces to be consumed by rendering subsystem.
  • WindowBase is a desktop-like window that can also be moved and resized on demand.
  • Window is a desktop window with title, decorations and buttons
  • EmbeddableRoot is intended to be embedded in other UI toolkits, so it also support some focus management