<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x" -->

---
title: Avalonia UI Theming - Buttons | Hand Coded From Scratch
description: Hand-coding every Avalonia button style from scratch — no theme generators, no AI shortcuts. We take the button file from the Setup episode and transform it...
canonical: https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Avalonia UI Theming - Buttons | Hand Coded From Scratch | daily.dev
og:description: Hand-coding every Avalonia button style from scratch — no theme generators, no AI shortcuts. We take the button file from the Setup episode and transform it...
og:url: https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x
og:image: https://api.daily.dev/og/posts/s8vKSwp5x.png
og:image:alt: Avalonia UI Theming - Buttons | Hand Coded From Scratch
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Avalonia UI Theming - Buttons | Hand Coded From Scratch

**[AngelSix](https://daily.dev/sources/angelsix)** · 30 min read · 0 upvotes · 0 comments

## Summary

Hand-coding every Avalonia button style from scratch — no theme generators, no AI shortcuts. We take the button file from the Setup episode and transform it into a full prototype sketch theme, covering all button states: Default, Hover, Pressed, Disabled, and Accent.

By the end you'll understand exactly how Avalonia's control templates and theme resources work — and how to override them with confidence.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How to display all button states visually in the Avalonia designer
• Editing ButtonBackground, ButtonForeground and BorderBrush per state
• Creating preview classes (previewhover, previewpressed) for design-time visualisation
• Styling Accent buttons with LinearGradientBrush
• Adding dashed borders using ControlTemplate and Rectangle
• Changing font family for a hand-sketched prototype feel

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
0:00  – Introduction & project goal
0:43  – Initial button setup & identifying theme gaps
1:27  – Setting up button states in XAML (Default, Hover, Pressed, Disabled)
2:51  – Setting up Accent button states
4:33  – Integrating the Prototype theme namespace
6:44  – Modifying default button backgrounds
10:00 – Modifying Pressed, Disabled & Foreground colours
12:25 – Applying preview styles for Hover and Pressed states
15:00 – Modifying button borders
16:17 – Changing font family to a prototype style
16:48 – Styling Accent button backgrounds with gradients
23:00 – Adding dashed borders to Accent buttons via ControlTemplate
30:37 – Wrap-up

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Initial Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
🌐 AngelSix: https://www.angelsix.com

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#avalonia #avaloniaui #xaml #csharp #dotnet #uiux #desktopapp #softwaretutorial #coding

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=oKjk6pyyARI>

---

[View this post on daily.dev](https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Avalonia UI Theming - Buttons | Hand Coded From Scratch","url":"https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x"},"datePublished":"2026-10-04T13:04:33.783Z","dateModified":"2026-10-04T22:01:35.185Z","description":"Hand-coding every Avalonia button style from scratch — no theme generators, no AI shortcuts. We take the button file from the Setup episode and transform it...","image":"https://i.ytimg.com/vi/oKjk6pyyARI/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/oKjk6pyyARI/sddefault.jpg","isAccessibleForFree":true,"articleSection":"AngelSix","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AngelSix","logo":"https://media.daily.dev/image/upload/s--h1ikmN_u--/f_auto,q_auto/v1791119063/logos/angelsix?_a=BAMAMicg0","url":"https://daily.dev/sources/angelsix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/avalonia-ui-theming---buttons-hand-coded-from-scratch-s8vkswp5x","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT30M","video":{"@type":"VideoObject","name":"Avalonia UI Theming - Buttons | Hand Coded From Scratch","description":"Hand-coding every Avalonia button style from scratch — no theme generators, no AI shortcuts. We take the button file from the Setup episode and transform it...","thumbnailUrl":"https://i.ytimg.com/vi/oKjk6pyyARI/sddefault.jpg","uploadDate":"2026-10-04T13:04:33.783Z","duration":"PT30M","url":"https://api.daily.dev/r/s8vKSwp5x","embedUrl":"https://www.youtube.com/embed/oKjk6pyyARI"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AngelSix","item":"https://daily.dev/sources/angelsix"},{"@type":"ListItem","position":3,"name":"Avalonia UI Theming - Buttons | Hand Coded From Scratch"}]}
```

