Uploaded December 2024 | 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 Calendar Control From Scratch (Multiple Selection Modes)
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 wont 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 YOULL LEARN
━━━━━━━━━━━━━━━━━━━
• How to read a large XAML control file you didnt write — the background-override trick for spotting sections at a glance
• Why the drop down text box wont 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 doesnt 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] – Whats next — event dots and an event viewer
[31:41] – Sign off
━━━━━━━━━━━━━━━━━━━
🔗 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, Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━
01 — Setup — https://www.youtube.com/watch?v=rUKlQnjU0tc
02 — Buttons — https://www.youtube.com/watch?v=oKjk6pyyARI
03 — Button Spinner Anatomy — https://www.youtube.com/watch?v=WMaTbXkvm9g
04 — Designing a Theme System — https://www.youtube.com/watch?v=I5halHoNfH0
05 — Checkbox Control Deep Dive — https://www.youtube.com/watch?v=uIimnwjITT0
06 — Building a Custom Checkbox — https://www.youtube.com/watch?v=uv1bNrfCjtY
07 — Theme Engine From Scratch — https://www.youtube.com/watch?v=NXz8hwITg5U
08 — Building a Design Token System — https://www.youtube.com/watch?v=QMVdxRZqaU8
09 — I Let AI Refactor Everything — https://www.youtube.com/watch?v=5-p_fnOi0As
10 — One Token System for the Entire Theme — https://www.youtube.com/watch?v=JEcD1XXIiA8
11 — Avalonia Styles Not Working? — https://www.youtube.com/watch?v=OhJN8Ssp2hA
12 — A Full Icon System — https://www.youtube.com/watch?v=N5HPe5GYCPo
13 — Breaking Every Control On Purpose — https://www.youtube.com/watch?v=OmVFU-iowqI
14 — A Tool That Finds Bugs My Compiler Cant See — https://www.youtube.com/watch?v=WQB5kFJWRmc
15 — The Accent System — https://www.youtube.com/watch?v=YFQEVLaYk94
16 — The Color Ramp That Themes Your Whole App — https://www.youtube.com/watch?v=xhnUQOOrShs
17 — A Maintainable Token System — https://www.youtube.com/watch?v=tg2gSQRJtmY
18 — Automatic Dark Mode From a Single Theme — https://www.youtube.com/watch?v=m2WjfZAOUyM
19 — This Video — Calendar Control From Scratch Avalonia Calendar Control From Scratch (Multiple Selection Modes)](https://i.ytimg.com/vi/EZE8MFbcoAE/mqdefault.jpg)







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