Avalonia UI Theming - Theme Engine From Scratch | No AI @AngelSix
Avalonia UI Theming - Theme Engine From Scratch | No AI  @AngelSix
Uploaded May 2026 | Updated September 2026, 3 weeks ago
Avalonia has never had a proper theme engine — until now. After a full week of deep refactoring, I've designed and built a brand new C#-driven theme engine that replaces static XAML resource dictionaries with dynamic, MVVM-bound, fully IntelliSense-supported theme properties. No AI wrote this. A real person architected every piece.

This is the biggest leap forward in the series so far. The entire theming system has been reduced to just two classes and a NuGet package — and it gives you absolute power over your themes: live switching, data-bound values, even themes that react to external events in real-time.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Why defining themes in XAML is fundamentally limiting — and the case for C# instead
• How current Avalonia theming fails: hard-coded values, no IntelliSense, no binding
• The dead ends I hit (including why modifying XAMLX was a non-starter)
• The breakthrough: markup extensions as the entry point for theme:PropertyName syntax
• Full IntelliSense for every theme property directly in XAML
• ThemeContext — a singleton injected via DI that holds the active theme
• Themes as simple C# classes inheriting from an abstract Theme base
• Live theme switching: toggle themes at runtime and watch the UI update instantly
• Binding theme values to external data — including a demo where BaseScale changes every second from the system clock
• Auto-generated C# files that power the IntelliSense and markup resolution

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction — a week of redesigning the theme system
[2:29] – Why XAML is the wrong place to define themes
[4:50] – The XAMLX dead end — why patching the compiler wasn't viable
[7:24] – The breakthrough: markup extensions & the new architecture
[9:15] – ThemeContext, dependency injection & the singleton pattern
[10:30] – Themes as C# classes — inheriting from abstract Theme
[12:02] – Full IntelliSense demo for theme: syntax in XAML
[13:45] – Live theme switching — toggling themes at runtime
[15:20] – Binding ThemeContext in XAML & the single naming requirement
[16:10] – How auto-generated files power the system behind the scenes
[20:00] – The crazy demo: BaseScale driven by the system clock
[21:07] – Wrap up & what's next

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: youtube.com/watch?v=oKjk6pyyARI
▶ Part 3 – Button Spinner Anatomy: youtube.com/watch?v=WMaTbXkvm9g
▶ Part 4 – Designing a Theme System: youtube.com/watch?v=I5halHoNfH0
▶ Part 5 – Checkbox Anatomy: youtube.com/watch?v=uIimnwjITT0
▶ Part 6 – Checkbox Styling: youtube.com/watch?v=uv1bNrfCjtY
📺 Full Series Playlist: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
💾 Source Code: github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
🌐 AngelSix: angelsix.com

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#avalonia #avaloniaui #xaml #csharp #dotnet #uiux #desktopapp #softwaretutorial #coding
Avalonia UI Theming - Theme Engine From Scratch | No AII Let AI Write My C# Backend (Big Mistake)Preparing for Domain Driven DesignAvalonia Styles Not Working? Youre Breaking This RuleBreaking Every Avalonia Control On PurposeReflection in Avalonia UI: Restoring Data Properly70. Advanced Avalonia UI - Refactoring for Production CodeAI Generated This Mess—Heres How I Fixed ItREVIEW: Number Guessing Game - C# Mastery Course50. Avalonia UI Real World - Cleaning Up the MessBuilding a Design Token System | Dev + AI54. Avalonia UI Real World (Entity Framework TPT)
AngelSix |

Avalonia UI Theming - Theme Engine From Scratch | No AI

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER