Skip to content

Avalonia UI

September 29, 2023
May 3, 2022

Avalonia UI Framework
AvaloniaUI/Avalonia: A multi-platform .NET UI framework
AvaloniaCommunity/awesome-avalonia: A collection of interesting libraries and tools for Avalonia project.

AvaloniaUI/avalonia-dotnet-templates: Avalonia Templates for dotnet new

dotnet new --install Avalonia.Templates  # install templates
dotnet new --list avalonia
dotnet new avalonia.mvvm -o MyApp

Avalonia First Impressions
Getting started with Avalonia UI | InfoWorld
A Cross-Platform GUI Theme for Desktop .NET Core Applications
Multiplatform UI Coding with AvaloniaUI in Easy Samples. Part 1 - AvaloniaUI Building Blocks - CodeProject

Avalonia for beginners Series' Articles - DEV Community

Creating a cross platform desktop app in .NET Core (Part One) still have rough edges @2020-04
Creating a cross platform desktop app in .NET Core: Distribution for Windows (Part Two)
Creating a cross platform desktop app in .NET Core: Distribution for Mac (Part 3)

Multiplatform UI Coding with AvaloniaUI in Easy Samples. Part 1 - AvaloniaUI Building Blocks - CodeProject
Multiplatform Avalonia .NET Framework Programming Basic Concepts in Easy Samples - CodeProject
Basics of XAML in Easy Samples for Multiplatform Avalonia .NET Framework - CodeProject

Nikita Tsukanov - AvaloniaUI - cross-platform XAML-oriented .NET UI framework - YouTube
A Cross Platform .NET UI Framework - Hello World in Avalonia UI - YouTube
Building Engaging Cross Platform Applications using Rider and Avalonia - YouTube

Comparison

Comparison with Xamarin and projects with similar goals 路 Issue #587 路 AvaloniaUI/Avalonia
Differences from Avalonia 路 Issue #17 路 unoplatform/uno

Recommend to use Events in ViewModel instead of Triggers in XAML.

AXAML

Introduction to XAML - Avalonia
Styles - Avalonia supports Selector

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Window.Styles>
        <Style Selector="TextBlock.h1">
            <Setter Property="FontSize" Value="24"/>
            <Setter Property="FontWeight" Value="Bold"/>
        </Style>
    </Window.Styles>

    <TextBlock Classes="h1">I'm a Heading!</TextBlock>
</Window>

Controls

Avalonia UI Framework - API
Avalonia/samples at master 路 AvaloniaUI/Avalonia
npolyak/NP.Avalonia.Visuals
amwx/FluentAvalonia: Control library focused on fluent design and bringing more WinUI controls into Avalonia

XAML reports namespace error when registering Click attribute to handler.
I used button.Click += ClickHandker in code behind (after InitializeComponent() call).

Custom Controls

AvaloniaUI custom SkiaSharp rendering demo - YouTube

How to create a custom rendering control ? 路 Issue #2176 路 AvaloniaUI/Avalonia ImmediateRenderer, new DrawingContext(RenderTargetBitmap bitmap)

How to render SKCanvas with DrawingContext? [Question] 路 Issue #2492 路 AvaloniaUI/Avalonia
AvaloniaUI custom draw operations using SkCanvas - YouTube

AvaloniaUI/Avalonia.GIF: GIF image renderer and player for Avalonia UI Framework
wieslawsoltes/Draw2D: https://wieslawsoltes.github.io/Draw2D/

Dialogs

creating a MVVM service is too much over head, just call the service functions in code behind

Using FileDialogs for MVVM 路 Discussion #5344 路 AvaloniaUI/Avalonia ViewLocator + async functions
grokys/FileDialogMvvm: Example of showing a file dialog using ReactiveUI interactions ReactiveUI's Interaction
mysteryx93/HanumanInstitute.MvvmDialogs: Library simplifying the concept of opening dialogs from a view model when using MVVM
OpenFileDialog, Avalonia.Controls C# (CSharp) Code Examples - HotExamples