Uploaded May 2020 | Updated November 2026, 5 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.
Support what I do and pay for me to survive
angelsix.com/donate
Merchandise
teespring.com/stores/angelsix
My Setup & Recommendations
amazon.co.uk/shop/angelsix
Live Chat at Discord
discordapp.com/invite/eHr5BMk
Source Code
github.com/angelsix/course-csharp-mastery
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.
Support what I do and pay for me to survive
angelsix.com/donate
Merchandise
teespring.com/stores/angelsix
My Setup & Recommendations
amazon.co.uk/shop/angelsix
Live Chat at Discord
discordapp.com/invite/eHr5BMk
Source Code
github.com/angelsix/course-csharp-mastery
![Building a Custom Checkbox: Avalonia UI Deep Dive
Finishing off the Avalonia Checkbox — cleaning up duplication, locking in all visual states, and pushing further towards a unified theme system. No AI shortcuts, just real hand-coded engineering. We fix scaling, foreground pass-through, hover states, indeterminate styling, and more.
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 corner radius and stroke thickness as shared static resources
• Correctly passing Foreground through TemplateBinding into child elements
• Eliminating code duplication across checkbox states using the theme colour system
• Applying numbered ThemeColor gradients for hover, pressed and disabled states
• How ViewBox and RelativeSource binding fixes checkbox scaling when size changes
• Styling all three checkbox states: Unchecked, Checked, and Indeterminate
• Replacing the indeterminate unknown panel with a clean dedicated rectangle
• Why style priority order matters and how to control which properties win
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction & recap — theme value sharing limitations
[0:36] – Resuming checkbox styling & reviewing the stream geometry tick
[2:35] – Main theme structure & TemplateBinding Foreground pass-through
[2:57] – Introducing default corner radius & stroke thickness resources
[6:57] – Code duplication problem & centralising theme colours
[9:08] – Applying numbered ThemeColor gradients for visual states
[13:31] – ViewBox revisited — Grid & Panel layout for tick scaling
[16:16] – Hover (pointer over) state styling
[21:10] – Checked state styling & style priority order
[26:16] – Indeterminate state — replacing the unknown panel with a rectangle
[40:40] – Fixing checkbox scaling with ViewBox & RelativeSource height-to-width binding
[45:03] – 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
📺 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 Building a Custom Checkbox: Avalonia UI Deep Dive](https://i.ytimg.com/vi/uv1bNrfCjtY/mqdefault.jpg)








![Code Reviewing Is Boring
Time to put the human back in the loop. After a few weeks of letting my agents work on the Avalonia theme engine, I review their changes in Rider and find the details that still need human judgement: inconsistent padding, confusing preview updates and code that does not belong in the template.
Along the way: button alignment and icon bindings, shared spacing tokens, exceptions for design-time sample data, and why a size token ending in “double” is more confusing than it first looks. There is also a new AI-assisted editing style to try out, with a little help from Rusty the pug. Part of the series on building a custom Avalonia UI theme from scratch.
━━━━━━━━━━━━━━━━━━━
📌 WHAT YOULL LEARN
━━━━━━━━━━━━━━━━━━━
• How to review AI-written UI code without trusting the visuals alone
• How button alignment and icon padding bind to the templated parent
• Why inconsistent control padding needs shared defaults, not individual patches
• How data-template placement affects the designer preview workflow
• Why design-time sample data can justify an exception to normal binding rules
• How typed size tokens can be made less confusing to use in XAML
• Why explicit types can make view-model code easier to review
━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━
[0:00] – Putting the human back in the loop
[0:38] – Reviewing the theme work in progress
[1:17] – The accidental push and reviewing Git changes
[1:52] – Button alignment and the clipping fix
[3:25] – Control themes, bindings and icon support
[4:20] – Testing alignment and confusing preview updates
[5:18] – Recording the compile issue for investigation
[6:02] – Checking the application and incomplete previews
[6:41] – Finding the AutoCompleteBox padding issue
[7:23] – Planning shared default padding tokens
[8:35] – Trying AI-assisted video editing
[9:01] – Rusty explains the background noises
[9:44] – Sample data in XAML or a demo view model?
[10:38] – Why one preview updates and another does not
[11:41] – A quick break to feed the pug
[12:02] – Reviewing and removing a stray press animation
[13:03] – ButtonSpinner and design-time preview rules
[14:42] – The data-template placement mystery explained
[15:22] – More preview checks and unexpected theme changes
[16:17] – Finding the calendar event-marker style
[17:01] – Questioning the radius token naming
[18:13] – “Double” is the type, not twice the size
[18:56] – Planning automatic type handling for theme values
[19:52] – A quick look at the carousel
[20:28] – Remaining review work and explicit type preferences
[21:42] – Final visual review and the next tasks
[23:00] – Wrapping up
━━━━━━━━━━━━━━━━━━━
🔗 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
18 — Automatic Dark Mode From a Single Theme — https://www.youtube.com/watch?v=m2WjfZAOUyM
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 — This Video — Reviewing AI-written Avalonia themes Code Reviewing Is Boring](https://i.ytimg.com/vi/yiZcrImMsXg/mqdefault.jpg)
