Uploaded July 2026 | Updated November 2026, 3 hours ago
Every AI model gets Avalonia wrong. Not slightly wrong — structurally, fundamentally wrong. Claude, GPT, Qwen — none of them understand how Avalonia layouts actually work. They've been trained on TypeScript, CSS, and HTML. They have no visual brain for XAML.
So I'm building one from scratch.
This is the first video in a series documenting my journey to create an open-weight AI model that writes real, production-grade Avalonia code. We start exactly where every training pipeline should: making the model fail on purpose — so we know precisely what to fix.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
► Why every current AI model is structurally broken for Avalonia UI
► The synthetic data bootstrapping technique for targeted model training
► AI Mecha — my custom multi-agent harness application and how it works
► The Universal UI Layout Loss framework (inner positioning, finite vs infinite space, state selectors)
► How to intentionally break a model to reveal exactly what to fix
► The full roadmap: basic markdown prompts → RAG → fine-tuning → open-weight model release
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 CHAPTERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0:00 Why AI Fails at Avalonia
0:39 AI Mecha: The Multi-Agent Workflow App
1:34 From Cloud to Local AI (The Journey)
3:09 The Goal: Training From Scratch
3:46 Making the Model Fail on Purpose
4:49 Synthetic Data Bootstrapping Explained
5:26 Universal UI Layout Loss Framework
7:36 Setting Up the Test Environment
9:06 Testing Llama: First Prompt
12:21 Analysing Llama's Failures
13:34 Refining the Prompt
19:01 Switching to Qwen
22:19 Adding the Compilation Rule
26:00 Iterating on Output Quality
28:26 The Linting Problem
29:31 What Comes Next
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 AngelSix: angelsix.com
📂 GitHub Resources: github.com/angelsix
📋 Full Series Playlist: youtube.com/playlist?list=PLrW43fNmjaQUEVov5qPNrLyaBAKDCNcPD
Every AI model gets Avalonia wrong. Not slightly wrong — structurally, fundamentally wrong. Claude, GPT, Qwen — none of them understand how Avalonia layouts actually work. They've been trained on TypeScript, CSS, and HTML. They have no visual brain for XAML.
So I'm building one from scratch.
This is the first video in a series documenting my journey to create an open-weight AI model that writes real, production-grade Avalonia code. We start exactly where every training pipeline should: making the model fail on purpose — so we know precisely what to fix.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
► Why every current AI model is structurally broken for Avalonia UI
► The synthetic data bootstrapping technique for targeted model training
► AI Mecha — my custom multi-agent harness application and how it works
► The Universal UI Layout Loss framework (inner positioning, finite vs infinite space, state selectors)
► How to intentionally break a model to reveal exactly what to fix
► The full roadmap: basic markdown prompts → RAG → fine-tuning → open-weight model release
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📋 CHAPTERS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0:00 Why AI Fails at Avalonia
0:39 AI Mecha: The Multi-Agent Workflow App
1:34 From Cloud to Local AI (The Journey)
3:09 The Goal: Training From Scratch
3:46 Making the Model Fail on Purpose
4:49 Synthetic Data Bootstrapping Explained
5:26 Universal UI Layout Loss Framework
7:36 Setting Up the Test Environment
9:06 Testing Llama: First Prompt
12:21 Analysing Llama's Failures
13:34 Refining the Prompt
19:01 Switching to Qwen
22:19 Adding the Compilation Rule
26:00 Iterating on Output Quality
28:26 The Linting Problem
29:31 What Comes Next
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS & RESOURCES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🌐 AngelSix: angelsix.com
📂 GitHub Resources: github.com/angelsix
📋 Full Series Playlist: youtube.com/playlist?list=PLrW43fNmjaQUEVov5qPNrLyaBAKDCNcPD








![Avalonia UI Deep Dive: Button Spinner XAML Anatomy
Dissecting the Avalonia Button Spinner control from the inside out — no AI shortcuts, just real hand-coded understanding. Before we style it, we need to know exactly how its built. In this episode we crack open the full XAML control theme and examine every piece.
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 the Button Spinner control theme is structured in XAML
• What the Margin Multiplier Converter does and why its needed
• How Stream Geometry draws the up/down arrow icons as Path Icons
• How Repeat Buttons are embedded and their default template overridden
• The role of Data Validation Errors in the control template
• How pseudo-classes (:left, :error) drive state-based layout changes
• The full DockPanel, Content Presenter and Stack Panel layout explained
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00] – Introduction & series recap
[0:46] – Upgrade to Avalonia 12 & prototype UI philosophy
[1:48] – Controls overview & choosing the Button Spinner
[2:48] – Avalonia control structure: resource dictionary & design preview
[4:27] – Button Spinner control theme & Repeat Button target types
[5:35] – Margin Multiplier Converter & border thickness
[8:47] – Stream Geometry for up/down arrow icons
[10:57] – Repeat Button template & overriding default visuals
[13:29] – Main Button Spinner control template structure
[14:17] – Pseudo-class selectors: :left layout & :error styling
[15:20] – Data Validation Errors wrapper explained
[16:52] – Core layout: Border, DockPanel, Content Presenter & Repeat Buttons
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: https://www.youtube.com/watch?v=oKjk6pyyARI
💾 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 Deep Dive: Button Spinner XAML Anatomy](https://i.ytimg.com/vi/WMaTbXkvm9g/mqdefault.jpg)

