Avalonia 11, a cross-platform framework for .NET based on the XAML presentation language, is out with a raft of new features including a new composition renderer, mobile platform support for iOS and Android, and WebAssembly support to allow running directly in the browser.
The latest version is a big release. Along with the above, there is a Text Inlines feature for complex formatted text blocks, reworked ItemsControl for smooth virtual controls with many items, improved control theming, new bitmap effects such as blur and drop shadows, 3D transforms, and experimental support for Apple’s Metal API for accelerated graphics.
Avalonia also uses the Skia cross-platform 2D graphics library, and on Windows only, DirectX.
The most common Avalonia design pattern is either one called ReactiveUI or another called Community Toolkit, both of which follow the MVVM (Model – View – ViewModel) pattern but in different ways, and both of which can be applied to any .NET application framework, not just Avalonia.
Performance improvements are claimed for Avalonia 11, including AOT (Ahead-of-time) compilation and trimming (removing unused code). The team has also previewed support for Apple’s forthcoming visionOS. Accessibility support has historically been a weak point in Avalonia, but version 11 introduces new accessibility features which, the team states, “lay the groundwork for full accessibility support.”
Microsoft has its own official solution for cross-platform .NET, called MAUI (Multi-platform App UI), but it has several limitations, including lack of Linux support, macOS support limited to Catalyst apps designed for sharing code with iPad, and Windows support limited to WinUI 3. Another long-standing issue with MAUI, which has evolved from the Xamarin platform, is that the XAML it uses is incompatible with that used by WPF (Windows Presentation Foundation).
Avalonia is an open-source alternative that uses a different model than MAUI, drawing its own visual controls rather than using native controls. This is a similar approach to that of Google’s popular Flutter framework. Another feature which endears Avalonia to long-term .NET developers is that the XAML is similar to WPF XAML.
As a community project, Avalonia lacks the resources Microsoft is able to put behind MAUI. Its popularity has been remarkable though, and it is among the most popular projects which are part of the .NET Foundation. The issue list on GitHub shows both the level of interest and the fact that there are plenty of outstanding items, currently over 1,100 open and 4,200 closed. The project has support in the JetBrains Rider IDE and a plug-in for Visual Studio, but not (much) yet for Visual Studio Code though it is a popular request.
Developers should expect some rough edges but there is a sense in the community that the project is pulling in the right direction – something which is not always true of Microsoft’s official solutions.