Avalonia Xaml logo

Avalonia Xaml

Community
linuxdevel
avalonia-xaml

Use when writing or reviewing Avalonia XAML markup, .axaml files, XML namespaces, code-behind, markup extensions, runtime XAML loading, or building UI without XAML in code.

Overview

Publisherlinuxdevel
RepositoryAvalonia-skills
Skill nameavalonia-xaml
Stars
50
Forks
4
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by linuxdevel on GitHub. Read the source before you install it.

Installation

Install the Avalonia Xaml AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-xaml
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/linuxdevel/Avalonia-skills.git /tmp/Avalonia-skills
mkdir -p .claude/skills
cp -r /tmp/Avalonia-skills/skills/avalonia/avalonia-xaml .claude/skills/avalonia-xaml
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Avalonia Xaml in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Avalonia Xaml on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Avalonia Xaml is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Avalonia XAML

Overview

Avalonia uses .axaml extension (not .xaml) to avoid Visual Studio WPF tooling conflicts. XAML is optional; full code-only UI is supported. (12.0+) compiled bindings are ON by default (AvaloniaUseCompiledBindingsByDefault=true): {Binding} maps to CompiledBinding, so x:DataType is required wherever bindings are used. In 11.x compiled bindings are opt-in ({CompiledBinding} / x:CompileBindings="True"). Escape hatch: {ReflectionBinding Path} or x:CompileBindings="False".

File Structure

Every .axaml file requires the Avalonia root namespace and language namespace:

xml
<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="using:MyApp.ViewModels"
        x:Class="MyApp.MainWindow"
        x:DataType="vm:MainWindowViewModel"
        Title="My App"
        Width="800" Height="450">

    <TextBlock Text="{Binding Greeting}" />

</Window>

Corresponding code-behind:

csharp
// MainWindow.axaml.cs
using Avalonia.Controls;

namespace MyApp;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }
}

XML Namespaces

Namespace Syntax

SyntaxUse caseExample
using:Same solution assemblies (preferred)xmlns:vm="using:MyApp.ViewModels"
clr-namespace:External assemblies (requires ;assembly=)xmlns:ctrl="clr-namespace:MyLib.Controls;assembly=MyLib"
URIFramework namespacesxmlns="https://github.com/avaloniaui"

Common Namespaces

PrefixURI / SyntaxPurpose
(default)https://github.com/avaloniauiAll Avalonia controls
x:http://schemas.microsoft.com/winfx/2006/xamlXAML language features
vm:using:MyApp.ViewModelsViewModel types
conv:using:MyApp.ConvertersConverter classes
sys:using:SystemSystem types (Math, String, etc.)

Markup Extensions

ExtensionPurposeExample
{Binding}Compiled binding in 12.0+ (needs x:DataType); reflection binding in 11.xText="{Binding Name}"
{CompiledBinding}Explicit compile-time checked binding (all versions)Text="{CompiledBinding Name}"
{ReflectionBinding}Runtime reflection binding; opt-out when no x:DataType (12.0+; 11.x: use {Binding})Text="{ReflectionBinding Name}"
{StaticResource}One-time resource lookupFill="{StaticResource AccentBrush}"
{DynamicResource}Live resource lookup (updates on change)Background="{DynamicResource SystemControlBackground}"
{x:Static}Static field/propertyValue="{x:Static sys:Math.PI}"
{x:Type}Type referenceTargetType="{x:Type Button}"
{x:Null}Null literalTag="{x:Null}"
{OnPlatform}Per-platform valueFontSize="{OnPlatform 12, macOS=14}"
{OnFormFactor}Per-form-factor valueWidth="{OnFormFactor 200, Mobile=100}"

x: Attributes

AttributePurposeNotes
x:ClassLinks AXAML to code-behind partial classMust match namespace + class name exactly
x:NameNames control for code-behind accessGenerates a typed field in partial class
x:KeyResource dictionary keyRequired for resources in <ResourceDictionary>
x:DataTypeCompiled binding root typeRequired on root or DataTemplate when using compiled bindings
x:CompileBindingsEnable/disable compiled bindings per scopex:CompileBindings="False" to opt out
ExperimentalAttribute (12.0+)XAML honors [Experimental] on types/members: using them needs the diagnostic suppressed (<NoWarn>)

Code-Behind Pattern

csharp
// MyView.axaml.cs
using Avalonia.Controls;

namespace MyApp.Views;

public partial class MyView : UserControl
{
    public MyView()
    {
        InitializeComponent();
    }

    // Access named controls via generated fields
    private void OnButtonClick(object sender, RoutedEventArgs e)
    {
        // myButton is generated from x:Name="myButton" in AXAML
        myButton.IsEnabled = false;
    }
}
xml
<!-- MyView.axaml -->
<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="MyApp.Views.MyView">
    <Button x:Name="myButton"
            Content="Click Me"
            Click="OnButtonClick" />
</UserControl>

Code-Only UI (No XAML)

Preferred for: dynamic control creation, headless testing, generated UIs.

csharp
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;

var window = new Window
{
    Title = "Code Only",
    Width = 400,
    Height = 300,
    Content = new StackPanel
    {
        Spacing = 8,
        Margin = new Thickness(16),
        Children =
        {
            new TextBlock { Text = "Hello, Avalonia!" },
            new Button
            {
                Content = "Click Me",
                HorizontalAlignment = HorizontalAlignment.Left
            }
        }
    }
};

Bindings in code:

csharp
var textBox = new TextBox { DataContext = viewModel };
// (12.0+) explicit types; `new Binding(...)` is a compat alias of ReflectionBinding
textBox.Bind(TextBox.TextProperty, new ReflectionBinding(nameof(MainViewModel.Name)));
textBox.Bind(TextBox.TextProperty, CompiledBinding.Create((MainViewModel vm) => vm.Name)); // (12.0+) AOT/trim safe
// (11.x)
textBox.Bind(TextBox.TextProperty, new Binding("Name"));

Gesture Events (12.0+)

Gesture attached events live directly on InputElement — drop the Gestures. prefix (Gestures is no longer public):

xml
<Border Pinch="OnPinch" ScrollGesture="OnScroll" Tapped="OnTapped" />
<!-- (11.x) <Border Gestures.Pinch="OnPinch" Gestures.ScrollGesture="OnScroll" /> -->

Resource Dictionaries

xml
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceInclude Source="avares://MyApp/Assets/Colors.axaml"/>
        </ResourceDictionary.MergedDictionaries>
        <SolidColorBrush x:Key="BrandBrush" Color="#5B4FCF"/>
    </ResourceDictionary>
</Application.Resources>
xml
<!-- Colors.axaml -->
<ResourceDictionary xmlns="https://github.com/avaloniaui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Color x:Key="BrandColor">#5B4FCF</Color>
</ResourceDictionary>

Runtime XAML for Previewers and Editors

For runtime-loaded documents, relative includes, existing root instances, diagnostics, and source locations, read references/runtime-xaml.md. It covers Avalonia 12.1 and 11.3; normal application views should keep the compiled InitializeComponent() path.

Common Mistakes

MistakeFix
Using .xaml extensionRename to .axaml
Missing xmlns="https://github.com/avaloniaui"Add as first attribute on root element
clr-namespace: without ;assembly= for external libxmlns:x="clr-namespace:MyLib;assembly=MyLib"
Compiled binding error: "Cannot resolve symbol" / {Binding} fails to compile after moving to 12Add x:DataType="vm:MyViewModel" to root or DataTemplate, or use {ReflectionBinding}
Gestures.Pinch="..." in 12.xPinch="..." (12.0+)
x:Name field not accessible in code-behindEnsure file is .axaml and InitializeComponent() is called
{StaticResource} not found at runtimeResource must be defined before use in document order
{DynamicResource} for performance-sensitive pathsUse {StaticResource} when resource never changes

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Avalonia Xaml AI skill do?

Use when writing or reviewing Avalonia XAML markup, .axaml files, XML namespaces, code-behind, markup extensions, runtime XAML loading, or building UI without XAML in code.

Why use Avalonia Xaml on TypingMind?

Because you install it once and use it with any model. Avalonia Xaml is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Avalonia Xaml in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-xaml. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Avalonia Xaml?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Avalonia Xaml?

As many as you like. As long as a model supports skills, you can use Avalonia Xaml with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Avalonia Xaml AI skill free?

Yes. It is published on GitHub by linuxdevel under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇