Avalonia Wpf Migrationのロゴ

Avalonia Wpf Migration

コミュニティ
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.

概要

公開者linuxdevel
リポジトリAvalonia-skills
スキル名avalonia-wpf-migration
スター
50
フォーク
4
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    linuxdevelがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルAvalonia Wpf MigrationをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-wpf-migration
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでAvalonia Wpf Migrationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にAvalonia Wpf Migrationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Avalonia Wpf Migrationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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

よくある質問

AIスキル「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.

TypingMindでAvalonia Wpf Migrationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Avalonia Wpf Migrationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにAvalonia Wpf Migrationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-wpf-migrationを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Avalonia Wpf Migrationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Avalonia Wpf Migrationは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもAvalonia Wpf Migrationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Avalonia Wpf Migration」は無料ですか?

はい。linuxdevelがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇