Uploaded February 2025 | Updated November 2026, 2 hours ago
Support me in my journey to giving back to the industry all my knowledge and helping the world with what I do. Spreading knowledge to those who cannot afford an education and helping those who want to better themselves.
Avalonia UI
avaloniaui.net
Support what I do and pay for me to survive
angelsix.com/donate
Live Chat at Discord
discordapp.com/invite/eHr5BMk
Support me in my journey to giving back to the industry all my knowledge and helping the world with what I do. Spreading knowledge to those who cannot afford an education and helping those who want to better themselves.
Avalonia UI
avaloniaui.net
Support what I do and pay for me to survive
angelsix.com/donate
Live Chat at Discord
discordapp.com/invite/eHr5BMk






![Avalonia UI Theming - Designing a Theme System From Scratch | No AI
Styling the Button Spinner turns into something much bigger — the foundations of a proper Avalonia theme system. No AI shortcuts, just real hand-coded engineering. We refactor colour duplication, centralise theme resources, and apply them consistently across controls.
This is part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI assistance.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How to centralise colours into a numbered ThemeColor resource system
• Creating SolidColorBrush and LinearGradientBrush from ThemeColor definitions
• Eliminating code duplication across control styles
• The difference between StaticResource and DynamicResource — and when it matters
• How to correctly use TemplateBinding vs DynamicResource in a ContentPresenter
• Applying consistent hover, pressed and disabled states across multiple controls
• Introducing ThemeColorAccent brushes for error and highlight states
• Why prototype theming starts colourless and builds up from layout first
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction & prototype style goals for the Button Spinner
[0:56] – Prototype philosophy: layout and precision before aesthetics
[1:36] – Identifying code duplication & the case for a central theme
[3:36] – Building the ThemeColor resource system (ThemeColorOne to Five)
[6:20] – Creating SolidColorBrush resources from ThemeColor definitions
[8:10] – Applying theme brushes to button hover & pressed states
[11:00] – Button template cleanup: removing redundant selectors & setters
[13:50] – Validating the refactor — everything builds and works
[15:00] – Styling the Button Spinner with the new theme system
[17:00] – Fixing DynamicResource vs TemplateBinding issues
[19:25] – ContentPresenter corrections & disabled state styling
[23:05] – Introducing ThemeColorAccent brushes for error & highlight states
[28:35] – Conclusion & next steps for the theme system
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: https://www.youtube.com/watch?v=oKjk6pyyARI
▶ Part 3 – Button Spinner Anatomy: https://www.youtube.com/watch?v=WMaTbXkvm9g
▶ Part 4 – Designing a Theme System: [link - add once live]
📺 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
💾 Source Code: https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
🌐 AngelSix: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#avalonia #avaloniaui #xaml #csharp #dotnet #uiux #desktopapp #softwaretutorial #coding Avalonia UI Theming - Designing a Theme System From Scratch | No AI](https://i.ytimg.com/vi/I5halHoNfH0/mqdefault.jpg)
![Getting Started With the New Avalonia Theme Engine
Ive finished the first release of the new Avalonia theme engine. In this video I walk through the documentation, create a fresh app and replace Fluent with the default theme.
Along the way: build-time checks for theme keys, the new AngelSix MVVM framework, simpler scaled sizes in XAML, editor shortcuts, dark mode and a primary accent button. Part of the series on building a custom Avalonia UI theme from scratch.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━
• How the theme engine catches invalid theme keys at build time
• Why I added my own MVVM framework and reorganised the repository
• How scaled sizes follow the themes base size
• How to create a new app and replace Fluent with AngelSix.Themes.Default
• What the engine loads and injects for you
• How solution-level editor shortcuts add the XAML namespaces
• How to set a window to dark mode and give a button the primary accent
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] - Back to coding with the new theme engine
[0:53] - New documentation and build-time checks
[1:59] - Theme rules for AI agents
[2:37] - The philosophy and the guide
[3:04] - Why AngelSix has its own MVVM framework
[3:39] - Repository layout and architecture
[5:02] - Simplifying XAML and scaled sizes
[6:52] - Themes, examples and project structure
[7:47] - Getting started with a fresh app
[8:28] - Update the Avalonia project templates
[9:19] - Remove the Fluent theme
[10:14] - Install AngelSix.Themes.Default
[10:53] - Add the default theme in App.axaml
[11:37] - What the engine injects automatically
[12:25] - Theme properties and the live preview
[13:20] - Add the XAML namespaces with an editor shortcut
[13:49] - Open the solution for the live templates
[14:32] - Set the window to dark mode
[15:21] - Create and centre the first button
[15:42] - Give the button the primary accent
[16:00] - First-release feedback and improvements
[17:05] - What the next videos will cover
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: https://github.com/angelsix
▶ Website: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES - Avalonia UI Theming
━━━━━━━━━━━━━━━━━━━
▶ Full series: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
22 - Code Reviewing Is Boring - https://www.youtube.com/watch?v=yiZcrImMsXg
23 - Reviewing an Overnight AI Agent Run on My Avalonia Theme - https://www.youtube.com/watch?v=J6Hbp6HeCN8
24 - Pixel Perfect Avalonia UI - https://www.youtube.com/watch?v=j7ok8wt1VcQ
25 - One Scale To Rule Them All - https://www.youtube.com/watch?v=jmIz2faBA1c
26 - This Video - Getting started with the new theme engine
#avalonia #avaloniaui #xaml #csharp #dotnet #theming #mvvm #desktopapp Getting Started With the New Avalonia Theme Engine](https://i.ytimg.com/vi/IICSd77tXq8/mqdefault.jpg)

![Reviewing an Overnight AI Agent Run on My Avalonia Theme
I left six local AI agents working through my Avalonia theme overnight. This is what they got done, what they got wrong, and what I learned about letting models fix UI they cant actually see.
The agents ran on Qwen 27B on my own machine, orchestrated by MiMo in AI Mecca, working from a plan I dictated: screenshot each control in the Theme Lab, check it against the theme rules, fix it and prove the fix with before and after shots. Along the way: turning screenshots into structured data so a model can work out alignment and padding, agents faking their screenshots and breaking the shared build, saving their lessons before the context runs out, and what the same run would have cost on paid models. Then we go through the results side by side, broken on one side and fixed on the other. Part of the series on building a custom Avalonia UI theme from scratch.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━
• How a team of local agents can work through every control in a theme overnight
• Why structured data from screenshots matters for models that cant see pixels
• How theme rules stop each control drifting from the shared tokens
• What goes wrong when agents fake their screenshots, and how to catch it
• Why it pays to save the agents lessons before their context is compacted
• What a run like this would cost in tokens on paid models
• Where the fixes still need a human, from calendar collapses to combo box padding
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] - Recursive self-improvement, or close to it
[0:44] - My personal AI Mecca app
[1:16] - Six local agents running at once
[1:43] - Shushing the agents voice
[2:02] - First look at the fixed themes
[3:15] - Linking every control to the theme
[3:52] - It fixed itself
[4:29] - The plan behind the overnight run
[5:00] - The structured data breakthrough
[6:21] - Dictating the rules
[7:05] - Watching the agents work
[7:41] - Fake screenshots and a broken build
[8:20] - Saving the lessons before compaction
[9:52] - Why Im so excited about this
[10:34] - What it would have cost in tokens
[11:28] - Why models dont see pixels
[12:40] - Wrap-up, before and after
[14:36] - Side by side, fixed against broken
[16:00] - Calendar collapse and padding
[17:05] - Checkboxes and SVG ticks
[18:33] - Combo boxes and the rest
[19:45] - Training models on the results
[20:47] - Final thoughts
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: https://github.com/angelsix
▶ Website: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES - Avalonia UI Theming
━━━━━━━━━━━━━━━━━━━
▶ Full series: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
19 - Calendar Control From Scratch - https://www.youtube.com/watch?v=EZE8MFbcoAE
20 - Build a Light vs Dark Preview Control - https://www.youtube.com/watch?v=tYTMNrN-3rw
21 - Hover Cropping, Corners and Contrast - https://www.youtube.com/watch?v=Oih-a3t687E
22 - Code Reviewing Is Boring - https://www.youtube.com/watch?v=yiZcrImMsXg
23 - This Video - An overnight AI agent run on the theme Reviewing an Overnight AI Agent Run on My Avalonia Theme](https://i.ytimg.com/vi/J6Hbp6HeCN8/mqdefault.jpg)
![One Token System for the Entire Avalonia Theme | Dev + AI
Hundreds of random hardcoded values scattered across every control in the theme. Margins,
thicknesses, font sizes — all over the place, inconsistent, unmaintainable. In this episode
we do the deduplication pass: collapsing everything down to a minimal, precise set of design
tokens that defines the entire theme system.
AI does the grunt work again — but the interesting part is what happens when it goes off-brief.
Real-time corrections, naming convention debates, a new Scaled markup extension that solves
proportional scaling for edge-case values, and a moment where the AI adds things I explicitly
told it not to. This is what collaborative AI development actually looks like in practice.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How to use AI to find and replace hundreds of scattered hardcoded values across a theme
• Adding new token properties to the engine: font family, font sizes, control height, icon
• What the Adorner Layer is and how to correctly map its thickness values to tokens
• How to establish naming conventions for thickness and spacing tokens — with real examples
• When NOT to add a value to the token set — the token bloat problem and how to avoid it
• Styling AutoCompleteBox: placeholder text, border brushes, padding, drop-down height
• The Scaled markup extension — what it is, why its needed, and how to implement it right
• How to handle negative margins using Edges + a negative multiplier
• How to correct AI when it goes off-brief — real examples of steering it back in real-time
• The ultimate goal: swap any compliant theme without a single line of application code
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction — new theme engine recap, goal of the deduplication pass
[0:25] – Using AI to find and replace legacy dynamic resources
[0:48] – New token properties added: font family, font sizes, control height, icon
[1:04] – Button control reviewed — already clean, moving on
[1:31] – What the Adorner Layer is and why it draws on its own visual layer
[3:08] – Prompting AI to merge AdornerLayer thickness values into the theme engine
[3:56] – Moving to AutoCompleteBox — placeholder, borders, padding
[8:49] – AIs first response on AdornerLayer thickness mapping
[11:08] – Decision: add dedicated thickness tokens to the engine
[11:59] – AI identifies further inline resources across other controls
[13:41] – Asking AI for thickness token naming conventions
[13:52] – AIs full token proposal reviewed and critiqued
[14:26] – The token bloat problem — when NOT to add a new token
[18:11] – Policy decision: how to snap stray values to existing tokens
[20:08] – AutoCompleteBox: border brush and accent brush tokens
[21:45] – MaxDropDownHeight and margin replacement
[23:27] – ⚠️ AI adds unwanted spacing values — correcting it in real-time
[24:17] – Introducing the Scaled markup extension for proportional custom values
[26:09] – Problem: Scaled extension hardcoded to ThemeContext — feedback given to AI
[28:17] – Further AI instructions on the Scaled extension + remaining issues
[32:59] – Bug fix discovered in Avalonia source code for AutoCompleteBox
[33:42] – Negative margins fixed with Edges + negative multiplier
[34:07] – Git diff review: AdornerLayer and AutoCompleteBox fully cleaned up
[36:45] – The ultimate goal: seamless theme swapping without any application code changes
[38:00] – Wrap up & next steps
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: https://www.youtube.com/watch?v=oKjk6pyyARI
▶ Part 3 – Button Spinner Anatomy: https://www.youtube.com/watch?v=WMaTbXkvm9g
▶ Part 4 – Designing a Theme System: https://www.youtube.com/watch?v=I5halHoNfH0
▶ Part 5 – Checkbox Anatomy: https://www.youtube.com/watch?v=uIimnwjITT0
▶ Part 6 – Checkbox Styling: https://www.youtube.com/watch?v=uv1bNrfCjtY
▶ Part 7 – Theme Engine From Scratch: https://www.youtube.com/watch?v=NXz8hwITg5U
▶ Part 8 – Design Token System: https://www.youtube.com/watch?v=QMVdxRZqaU8
▶ Part 9 – Stripping Legacy Code: https://www.youtube.com/watch?v=5-p_fnOi0As
📺 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
💾 Source Code: https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
🌐 AngelSix: https://www.angelsix.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#avalonia #avaloniaui #xaml #csharp #dotnet #aiagent #aitools #softwaretutorial #coding One Token System for the Entire Avalonia Theme | Dev + AI](https://i.ytimg.com/vi/JEcD1XXIiA8/mqdefault.jpg)