Uploaded September 2026 | Updated November 2026, 2 hours ago
The Avalonia theme engine just met the first control that genuinely tests it — a calendar, hand-coded from scratch.
This is the honest episode: I fix the bugs I left in rather than pretend the first version was right. The drop down that won't expand to fit its content, the calendar that changes size when expanded, and a selection state still hardcoded black and purple instead of bound to an accent colour — all of it found by reading 400 lines of XAML cold.
Along the way: a side-by-side dark theme preview, day cell selection states bound to accent brushes, the keyboard focus state pulling the wrong brush, and a size jump fixed with opacity instead of visibility. Part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━
• How to read a large XAML control file you didn't write — the background-override trick for spotting sections at a glance
• Why the drop down text box won't expand to fit content, and the HorizontalAlignment stretch fix
• The Chrome-less text box that removes a default focus ring without breaking the control
• Why the calendar changes size when expanding from month to year — the visibility vs opacity trade-off
• How to bind day cell selection states to accent brushes, and which brush the keyboard focus state should use
• How Theme.Kind retints the entire calendar instantly, and where event dots will attach
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] – No more ugly calendar — the plan and the bugs
[0:14] – The calendar view, the source commit, and getting these C# controls into Avalonia
[0:49] – The next feature: event dots and custom event values
[1:11] – Theme library issues, and why this file is 400+ lines
[1:28] – Single date, date range, month select, year select
[1:53] – The drop down picker version
[2:05] – Bug 1 — the text box doesn't expand to fit content
[2:21] – Bug 2 — the calendar changes size when expanded
[2:59] – Is the selection actually bound to an accent colour?
[3:37] – Reading 400 lines of XAML cold — my thought process
[4:16] – Selection modes — none, single, range
[5:19] – Finding the header by overriding the background
[7:26] – The Chrome-less text box — removing the focus ring
[10:14] – The marker strip — where event dots will live
[11:13] – Day and date cells — all the binding is in C#
[12:11] – The black and purple selection problem
[12:23] – Adding a dark theme preview side by side
[14:36] – Binding selection states to accent brushes
[17:28] – Fixing the in-range band styling
[18:30] – Fixing the keyboard focus state
[19:34] – Retinting with Theme.Kind — success, destructive, primary
[22:00] – Softening the selected border brush
[23:48] – The calendar size change — setting a fixed 500x500 to prove it
[26:01] – Visibility vs opacity — solving the size jump
[27:47] – Settling on natural growth as the default
[28:40] – Fixing the drop down text box width
[30:43] – What's next — event dots and an event viewer
[31:41] – Sign off
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: github.com/angelsix
▶ Website: angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES — Avalonia UI Theming, Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━
01 — Setup — youtube.com/watch?v=rUKlQnjU0tc
02 — Buttons — youtube.com/watch?v=oKjk6pyyARI
03 — Button Spinner Anatomy — youtube.com/watch?v=WMaTbXkvm9g
04 — Designing a Theme System — youtube.com/watch?v=I5halHoNfH0
05 — Checkbox Control Deep Dive — youtube.com/watch?v=uIimnwjITT0
06 — Building a Custom Checkbox — youtube.com/watch?v=uv1bNrfCjtY
07 — Theme Engine From Scratch — youtube.com/watch?v=NXz8hwITg5U
08 — Building a Design Token System — youtube.com/watch?v=QMVdxRZqaU8
09 — I Let AI Refactor Everything — youtube.com/watch?v=5-p_fnOi0As
10 — One Token System for the Entire Theme — youtube.com/watch?v=JEcD1XXIiA8
11 — Avalonia Styles Not Working? — youtube.com/watch?v=OhJN8Ssp2hA
12 — A Full Icon System — youtube.com/watch?v=N5HPe5GYCPo
13 — Breaking Every Control On Purpose — youtube.com/watch?v=OmVFU-iowqI
14 — A Tool That Finds Bugs My Compiler Can't See — youtube.com/watch?v=WQB5kFJWRmc
15 — The Accent System — youtube.com/watch?v=YFQEVLaYk94
16 — The Color Ramp That Themes Your Whole App — youtube.com/watch?v=xhnUQOOrShs
17 — A Maintainable Token System — youtube.com/watch?v=tg2gSQRJtmY
18 — Automatic Dark Mode From a Single Theme — youtube.com/watch?v=m2WjfZAOUyM
19 — This Video — Calendar Control From Scratch
The Avalonia theme engine just met the first control that genuinely tests it — a calendar, hand-coded from scratch.
This is the honest episode: I fix the bugs I left in rather than pretend the first version was right. The drop down that won't expand to fit its content, the calendar that changes size when expanded, and a selection state still hardcoded black and purple instead of bound to an accent colour — all of it found by reading 400 lines of XAML cold.
Along the way: a side-by-side dark theme preview, day cell selection states bound to accent brushes, the keyboard focus state pulling the wrong brush, and a size jump fixed with opacity instead of visibility. Part of a complete series on building a fully custom Avalonia UI theme from scratch, hand-coded with zero AI.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━
• How to read a large XAML control file you didn't write — the background-override trick for spotting sections at a glance
• Why the drop down text box won't expand to fit content, and the HorizontalAlignment stretch fix
• The Chrome-less text box that removes a default focus ring without breaking the control
• Why the calendar changes size when expanding from month to year — the visibility vs opacity trade-off
• How to bind day cell selection states to accent brushes, and which brush the keyboard focus state should use
• How Theme.Kind retints the entire calendar instantly, and where event dots will attach
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] – No more ugly calendar — the plan and the bugs
[0:14] – The calendar view, the source commit, and getting these C# controls into Avalonia
[0:49] – The next feature: event dots and custom event values
[1:11] – Theme library issues, and why this file is 400+ lines
[1:28] – Single date, date range, month select, year select
[1:53] – The drop down picker version
[2:05] – Bug 1 — the text box doesn't expand to fit content
[2:21] – Bug 2 — the calendar changes size when expanded
[2:59] – Is the selection actually bound to an accent colour?
[3:37] – Reading 400 lines of XAML cold — my thought process
[4:16] – Selection modes — none, single, range
[5:19] – Finding the header by overriding the background
[7:26] – The Chrome-less text box — removing the focus ring
[10:14] – The marker strip — where event dots will live
[11:13] – Day and date cells — all the binding is in C#
[12:11] – The black and purple selection problem
[12:23] – Adding a dark theme preview side by side
[14:36] – Binding selection states to accent brushes
[17:28] – Fixing the in-range band styling
[18:30] – Fixing the keyboard focus state
[19:34] – Retinting with Theme.Kind — success, destructive, primary
[22:00] – Softening the selected border brush
[23:48] – The calendar size change — setting a fixed 500x500 to prove it
[26:01] – Visibility vs opacity — solving the size jump
[27:47] – Settling on natural growth as the default
[28:40] – Fixing the drop down text box width
[30:43] – What's next — event dots and an event viewer
[31:41] – Sign off
━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━
▶ Full Avalonia Themes Playlist: youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
▶ Source Code (AvaloniaThemeLab): github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
▶ GitHub: github.com/angelsix
▶ Website: angelsix.com
━━━━━━━━━━━━━━━━━━━
📚 SERIES — Avalonia UI Theming, Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━
01 — Setup — youtube.com/watch?v=rUKlQnjU0tc
02 — Buttons — youtube.com/watch?v=oKjk6pyyARI
03 — Button Spinner Anatomy — youtube.com/watch?v=WMaTbXkvm9g
04 — Designing a Theme System — youtube.com/watch?v=I5halHoNfH0
05 — Checkbox Control Deep Dive — youtube.com/watch?v=uIimnwjITT0
06 — Building a Custom Checkbox — youtube.com/watch?v=uv1bNrfCjtY
07 — Theme Engine From Scratch — youtube.com/watch?v=NXz8hwITg5U
08 — Building a Design Token System — youtube.com/watch?v=QMVdxRZqaU8
09 — I Let AI Refactor Everything — youtube.com/watch?v=5-p_fnOi0As
10 — One Token System for the Entire Theme — youtube.com/watch?v=JEcD1XXIiA8
11 — Avalonia Styles Not Working? — youtube.com/watch?v=OhJN8Ssp2hA
12 — A Full Icon System — youtube.com/watch?v=N5HPe5GYCPo
13 — Breaking Every Control On Purpose — youtube.com/watch?v=OmVFU-iowqI
14 — A Tool That Finds Bugs My Compiler Can't See — youtube.com/watch?v=WQB5kFJWRmc
15 — The Accent System — youtube.com/watch?v=YFQEVLaYk94
16 — The Color Ramp That Themes Your Whole App — youtube.com/watch?v=xhnUQOOrShs
17 — A Maintainable Token System — youtube.com/watch?v=tg2gSQRJtmY
18 — Automatic Dark Mode From a Single Theme — youtube.com/watch?v=m2WjfZAOUyM
19 — This Video — Calendar Control From Scratch







![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)