Avalonia Wpf Migration logo

Avalonia Wpf Migration

Community
linuxdevel
avalonia-wpf-migration

Use when migrating a WPF application to Avalonia, mapping WPF concepts to Avalonia equivalents, or understanding differences between WPF and Avalonia APIs.

Overview

Publisherlinuxdevel
RepositoryAvalonia-skills
Skill nameavalonia-wpf-migration
Stars
50
Forks
4
Bundled files
Instructions only
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.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

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

Installation

Install the Avalonia Wpf Migration 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-wpf-migration
  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-wpf-migration .claude/skills/avalonia-wpf-migration
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Avalonia Wpf Migration 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 Wpf Migration 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 Wpf Migration 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 WPF Migration

Overview

Target: Avalonia 12.x (12.1.x recommended); 11.x notes are labeled (11.x); see avalonia-versions. Avalonia 12 requires net8.0+ (net10.0 recommended) — .NET Framework and netstandard2.0 targets are not supported, so retarget WPF apps on .NET Framework to modern .NET first (Avalonia 11.3 is the last line supporting them).

Avalonia's API is intentionally WPF-like. Most XAML, binding, and MVVM patterns transfer directly. Key differences: styling system, ControlTemplates → ControlThemes, no Triggers, .axaml extension, namespace differences.

Quick Mapping Table

WPFAvaloniaNotes
.xaml.axamlExtension differs
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns="https://github.com/avaloniaui"Root namespace
DependencyPropertyStyledProperty / DirectPropertySee property system
FrameworkElementControlBase for custom controls
UserControl (base)UserControlSame name, similar API
Control (for lookless)TemplatedControlDifferent base class
Style with TargetTypeControlTheme with TargetTypeStyling lookless controls
Style with TriggersStyle with nested styles + pseudoclassesNo Triggers in Avalonia
DataTriggerBinding + pseudoclass / Classes bindingPattern change
ResourceDictionary Source=ResourceInclude Source="avares://..."URI scheme differs
pack://application:,,,/avares://AssemblyName/Asset URI scheme
Window.ShowDialog()window.ShowDialog(owner)Requires owner parameter
MessageBox.Show()No built-in — use dialog or notificationAPI removed
Dispatcher.Invoke()Dispatcher.UIThread.InvokeAsync()Async-first
BindingOperations.ClearBinding()control.ClearValue(prop)Slightly different
x:Staticx:StaticSame
TemplateBindingTemplateBindingSame
RelativeSource Self{Binding $self.Property}Different syntax
RelativeSource AncestorType{Binding $parent[TypeName].Property}Different syntax
EventTrigger + StoryboardAnimation in stylesDifferent animation system
BitmapImage + UriBitmap + AssetLoaderDifferent image loading
IValueConverterIValueConverterSame interface
IMultiValueConverterIMultiValueConverterSame interface
ObservableCollection<T>ObservableCollection<T>Same
ICommandICommandSame
CollectionViewSourceNo equivalent — sort/filter/group in the ViewModel (e.g. DynamicData, LINQ); DataGridCollectionView (Avalonia.Controls.DataGrid) only for DataGridNo ICollectionView infrastructure
GroupBoxGroupBox (12.0+)11.x: HeaderedContentControl + styling
ListView + GridView (read-only columns)TableView (12.1+)12.0/11.x: DataGrid (Avalonia.Controls.DataGrid) or TreeDataGrid; DataGrid is maintenance-mode
DataGrid (editable)DataGrid (Avalonia.Controls.DataGrid, separate package)Not in core
TextBox watermark (e.g. Watermark in toolkits)TextBox.PlaceholderText (12.0+)11.x: Watermark (obsolete in 12)
DataObject / IDataObject (clipboard, drag-drop)DataTransfer + DataTransferItem (12.0+)11.x: DataObject; use DragDrop.DoDragDropAsync, DragEventArgs.DataTransfer
DragDrop.DoDragDropawait DragDrop.DoDragDropAsync(...) (12.0+)
Clipboard.SetText/GetTextclipboard.SetTextAsync / TryGetTextAsyncAsync
Frame + NavigationServiceContentControl + ViewModel swapMVVM pattern preferred

Styles: No Triggers

WPF:

xml
<!-- WPF - DOES NOT WORK in Avalonia -->
<Style TargetType="Button">
    <Style.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Background" Value="Red"/>
        </Trigger>
    </Style.Triggers>
</Style>

Avalonia:

xml
<Style Selector="Button:pointerover">
    <Setter Property="Background" Value="Red"/>
</Style>

ControlTemplate → ControlTheme

WPF:

xml
<Style TargetType="Button">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                ...
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Avalonia:

xml
<ControlTheme TargetType="Button" x:Key="{x:Type Button}">
    <Setter Property="Template">
        <ControlTemplate>
            ...
        </ControlTemplate>
    </Setter>
</ControlTheme>

RelativeSource Binding

xml
<!-- WPF -->
<TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=Title}"/>

<!-- Avalonia -->
<TextBlock Text="{Binding $parent[Window].Title}"/>
<TextBlock Text="{Binding $self.Tag}"/>
<TextBlock Text="{Binding $parent.Tag}"/>

Asset URIs

xml
<!-- WPF -->
<Image Source="pack://application:,,,/Assets/logo.png"/>

<!-- Avalonia -->
<Image Source="avares://MyApp/Assets/logo.png"/>

Dialogs

csharp
// WPF
MessageBox.Show("Hello");
var dialog = new OpenFileDialog();
dialog.ShowDialog();

// Avalonia
// Use StorageProvider for file dialogs (see avalonia-services skill)
// Use WindowNotificationManager for notifications
// For message dialogs: use a community library like MessageBox.Avalonia
// or implement a simple dialog Window
var result = await new ConfirmDialog("Are you sure?").ShowDialog<bool>(owner);

Dispatcher

csharp
// WPF
Dispatcher.Invoke(() => { /* UI update */ });

// Avalonia
await Dispatcher.UIThread.InvokeAsync(() => { /* UI update */ });
// or
Dispatcher.UIThread.Post(() => { /* fire-and-forget */ });

Bindings (12.0+)

Compiled bindings are the default: WPF-style {Binding Name} needs x:DataType on the root/DataTemplate, otherwise it fails to compile. Quick path for ported XAML: add x:DataType, or use {ReflectionBinding Name}, or set <AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>. Data-annotation validation is opt-in.

MVVM Frameworks

  • ReactiveUI: package ReactiveUI.Avalonia (12.x); Avalonia.ReactiveUI does not exist for 12.
  • CommunityToolkit.Mvvm: unchanged.
  • WPF SystemDecorations/WindowStyle-like tweaks → Window.WindowDecorations (12.0+).

What Works Without Changes

  • INotifyPropertyChanged implementations
  • ICommand implementations
  • ObservableCollection<T> usage
  • IValueConverter implementations
  • Data binding patterns (with namespace/syntax adjustments)
  • Most MVVM framework code (ReactiveUI, CommunityToolkit.Mvvm)
  • ItemsControl, ListBox (similar APIs); DataGrid needs the Avalonia.Controls.DataGrid package
  • Grid, StackPanel, DockPanel layouts (same attached properties)

Common Mistakes

  • Using WPF Trigger syntax — silently ignored or compile error
  • Using pack:// URIs — assets not found
  • Calling MessageBox.Show() — doesn't exist
  • Targeting net48 / netstandard2.0 with Avalonia 12 — unsupported
  • {Binding} without x:DataType in 12 — compile error
  • Using FrameworkElement as base class — use Control
  • Style TargetType without x:Key for ControlThemes — template not applied

Frequently asked questions

What does the Avalonia Wpf Migration AI skill do?

Use when migrating a WPF application to Avalonia, mapping WPF concepts to Avalonia equivalents, or understanding differences between WPF and Avalonia APIs.

Why use Avalonia Wpf Migration on TypingMind?

Because you install it once and use it with any model. Avalonia Wpf Migration 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 Wpf Migration in TypingMind?

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

Which AI models can use Avalonia Wpf Migration?

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 Wpf Migration?

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

Is the Avalonia Wpf Migration 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 👇