Logo van Avalonia Xaml

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.

Overzicht

Uitgeverlinuxdevel
RepositoryAvalonia-skills
Skillnaamavalonia-xaml
Sterren
50
Forks
4
Meegeleverde bestanden
1
LicentieMIT
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • 1 meegeleverde bestanden

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. Bestanden zijn alleen-lezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door linuxdevel op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Avalonia Xaml in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-xaml
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

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
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Avalonia Xaml in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Avalonia Xaml automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Avalonia Xaml niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

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

Meegeleverde bestanden

Het model leest deze bestanden wanneer nodig terwijl de skill geladen is. Ze worden beschikbaar gesteld als leesbare bestanden en worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill 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.

Waarom Avalonia Xaml gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Avalonia Xaml bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Avalonia Xaml in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-xaml. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Avalonia Xaml gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Avalonia Xaml gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Avalonia Xaml ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Avalonia Xaml gratis?

Ja. Deze skill is door linuxdevel op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇