Avalonia Mvvm logo

Avalonia Mvvm

Community
linuxdevel
avalonia-mvvm

Use when implementing the MVVM pattern in Avalonia, including ViewModels, INotifyPropertyChanged, ICommand, ReactiveUI, CommunityToolkit.Mvvm, or ViewModel-first navigation.

Overview

Publisherlinuxdevel
RepositoryAvalonia-skills
Skill nameavalonia-mvvm
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 Mvvm 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-mvvm
  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-mvvm .claude/skills/avalonia-mvvm
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Avalonia Mvvm 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 Mvvm 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 Mvvm 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 MVVM

Overview

MVVM: Model (data/business), View (.axaml), ViewModel (presentation logic, bindable state). ViewModel knows nothing about View. Views bind to ViewModel properties and commands.

INotifyPropertyChanged (Manual)

csharp
public class PersonViewModel : INotifyPropertyChanged
{
    private string _name = "";
    public string Name
    {
        get => _name;
        set { _name = value; PropertyChanged?.Invoke(this, new(nameof(Name))); }
    }
    public event PropertyChangedEventHandler? PropertyChanged;
}

CommunityToolkit.Mvvm (Recommended)

Source-generator based, no reflection, clean code.

csharp
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

public partial class MainViewModel : ObservableObject
{
    [ObservableProperty]
    private string _name = "";

    [ObservableProperty]
    [NotifyCanExecuteChangedFor(nameof(SaveCommand))]
    private bool _isDirty;

    [RelayCommand(CanExecute = nameof(CanSave))]
    private async Task SaveAsync()
    {
        // save logic
    }

    private bool CanSave() => IsDirty && !string.IsNullOrEmpty(Name);
}

NuGet: CommunityToolkit.Mvvm

Generated: Name property with change notification, NameChanged partial method hook, SaveCommand as AsyncRelayCommand.

ReactiveUI (Alternative)

csharp
using ReactiveUI;

public class MainViewModel : ReactiveObject
{
    private string _name = "";
    public string Name
    {
        get => _name;
        set => this.RaiseAndSetIfChanged(ref _name, value);
    }

    public ReactiveCommand<Unit, Unit> SaveCommand { get; }

    public MainViewModel()
    {
        var canSave = this.WhenAnyValue(x => x.Name, n => !string.IsNullOrEmpty(n));
        SaveCommand = ReactiveCommand.CreateFromTask(SaveAsync, canSave);
    }

    private async Task SaveAsync() { /* ... */ }
}
Avalonia 12.x (12.0+)Avalonia 11.x (11.x)
NuGetReactiveUI.Avalonia (12.1.x on NuGet requires Avalonia >= 12.1.3; later 14.x line exists — check NuGet)Avalonia.ReactiveUI (ends at 11.3.x)
Namespaceusing ReactiveUI.Avalonia;using Avalonia.ReactiveUI;

App setup (12.0+):

csharp
using ReactiveUI.Avalonia;

AppBuilder.Configure<App>()
    .UsePlatformDetect()
    .UseReactiveUI(rxui => { /* optional rxui.WithRegistration(...) */ })
    .RegisterReactiveUIViewsFromEntryAssembly();

(11.x) .UseReactiveUI() with no arguments. DI variants in 12: UseReactiveUIWithMicrosoftDependencyResolver, ...WithAutofac, ...WithDryIoc, ...WithNinject (separate ReactiveUI.Avalonia.* packages, namespace ReactiveUI.Avalonia.Splat). Base classes: ReactiveWindow<TVM>, ReactiveUserControl<TVM>; routing via <rxui:RoutedViewHost Router="{Binding Router}"/>.

ICommand (Manual)

csharp
public class RelayCommand : ICommand
{
    private readonly Action _execute;
    private readonly Func<bool>? _canExecute;

    public RelayCommand(Action execute, Func<bool>? canExecute = null)
    { _execute = execute; _canExecute = canExecute; }

    public event EventHandler? CanExecuteChanged;
    public bool CanExecute(object? p) => _canExecute?.Invoke() ?? true;
    public void Execute(object? p) => _execute();
    public void RaiseCanExecuteChanged() => CanExecuteChanged?.Invoke(this, EventArgs.Empty);
}

ViewLocator Pattern

Auto-maps ViewModels → Views by naming convention (FooViewModel → FooView):

csharp
public class ViewLocator : IDataTemplate
{
    public Control? Build(object? data)
    {
        if (data is null) return null;
        var name = data.GetType().FullName!.Replace("ViewModel", "View");
        var type = Type.GetType(name);
        return type != null
            ? (Control)Activator.CreateInstance(type)!
            : new TextBlock { Text = $"Not Found: {name}" };
    }
    public bool Match(object? data) => data is ViewModelBase;
}

Register in App.axaml:

xml
<Application.DataTemplates>
    <local:ViewLocator/>
</Application.DataTemplates>

ViewModel-First Navigation

Pattern: Router/NavigationViewModel holds current page ViewModel, ContentControl displays it:

xml
<ContentControl Content="{Binding CurrentPage}"/>
csharp
public partial class MainViewModel : ObservableObject
{
    [ObservableProperty]
    private ViewModelBase _currentPage = new HomeViewModel();

    public void NavigateTo(ViewModelBase page) => CurrentPage = page;
}

Design-Time DataContext

xml
<Window xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        d:DataContext="{d:DesignInstance vm:MainViewModel, IsDesignTimeCreatable=True}">

ObservableCollection for Lists

csharp
public ObservableCollection<PersonViewModel> People { get; } = new();

Use ObservableCollection<T> (not List<T>) so UI updates on add/remove.

Community Libraries

LibraryNuGet / RepoPurpose
CommunityToolkit.MvvmCommunityToolkit.MvvmSource-generator MVVM (ObservableObject, RelayCommand) — recommended
ReactiveUIReactiveUI.Avalonia (12.0+) / Avalonia.ReactiveUI (11.x)Reactive MVVM with Rx.NET observables
PrismPrism.AvaloniaFull MVVM framework with regions, modules, DI, dialogs
EpoxyEpoxy.AvaloniaLightweight multi-platform MVVM
FuncUIAvalonia.FuncUIF# MVU pattern with view DSL
ReactiveElmish.AvaloniaGitHub: JordanMarr/ReactiveElmish.AvaloniaF# MVU with XAML views
Stylet.AvaloniaStylet.AvaloniaLightweight ViewModel-first MVVM (Caliburn.Micro-inspired)
HanumanInstitute.MvvmDialogsHanumanInstitute.MvvmDialogs.AvaloniaOpen dialogs from ViewModel in pure MVVM
ReactiveValidationReactiveValidationFluent-style property validation with UI messages
Markup DeclarativeAvalonia.Markup.DeclarativeDeclarative C# UI and MVU helpers
Lemon.ModuleNavigationGitHub: NeverMorewd/Lemon.ModuleNavigation.NET Generic Host + module navigation
AsyncNavigationGitHub: NeverMorewd/AsyncNavigationAsync navigation via Microsoft.Extensions.DI

Common Mistakes

  • Using List<T> instead of ObservableCollection<T> — list changes not reflected in UI
  • Not calling PropertyChanged with exact property name — use nameof()
  • Doing UI work in ViewModel (creating controls, accessing DataContext)
  • Creating DispatcherTimer in a ViewModel off the UI thread in 12 — it uses the current thread's dispatcher, not always the UI thread
  • Async command without AsyncRelayCommand — exceptions swallowed, UI blocks
  • Using Avalonia.ReactiveUI in an Avalonia 12 project — package stops at 11.3.x; switch to ReactiveUI.Avalonia and using ReactiveUI.Avalonia;
  • Forgetting partial keyword on CommunityToolkit ViewModel class — source gen fails silently

Frequently asked questions

What does the Avalonia Mvvm AI skill do?

Use when implementing the MVVM pattern in Avalonia, including ViewModels, INotifyPropertyChanged, ICommand, ReactiveUI, CommunityToolkit.Mvvm, or ViewModel-first navigation.

Why use Avalonia Mvvm on TypingMind?

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

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

Which AI models can use Avalonia Mvvm?

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 Mvvm?

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

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