avalonia-mvvm

Implement MVVM patterns in Avalonia apps with CommunityToolkit.Mvvm.

2|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/Abdssamie/Quater --skill avalonia-mvvm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: avalonia-mvvm
Source: https://github.com/Abdssamie/Quater/tree/main/.opencode/skills/avalonia-mvvm
Command: npx skills add https://github.com/Abdssamie/Quater --skill avalonia-mvvm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers implement the MVVM pattern in Avalonia applications using CommunityToolkit.Mvvm, streamlining ViewModel creation, property notification, and command wiring to deliver responsive UIs.

Core Features & Use Cases

  • Implements ObservableObject-based ViewModels with [ObservableProperty] attributes for automatic property change notification.
  • Demonstrates RelayCommand usage for synchronous and asynchronous actions, including CanExecute logic.
  • Shows DataTemplates mapping for navigation and View-ViewModel separation in Avalonia apps.
  • Provides dependency injection patterns to pass services into ViewModels for testable, modular UI.
  • Use Case: Create a new Avalonia page with a ViewModel and bind to UI controls, then navigate between pages.

Quick Start

Create a new Avalonia MVVM module and reference CommunityToolkit.Mvvm. Define a ViewModel that inherits ObservableObject, add an [ObservableProperty] string Name, and expose a RelayCommand to save the name. Bind the properties in the View and wire up a simple DataTemplate for the ViewModel.

Frequently Asked Questions about avalonia-mvvm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement MVVM in Avalonia using CommunityToolkit.Mvvm?

Implement MVVM in Avalonia by creating ViewModels that inherit from ObservableObject, using [ObservableProperty] for change notifications, and RelayCommand for action wiring to bind data to responsive UI controls.

How do I set up dependency injection for ViewModels in Avalonia?

Set up dependency injection in Avalonia by registering services and ViewModels in a container, allowing services to be passed into ViewModels for testable, modular UI components and responsive bindings.

What is the best way to navigate between multiple views in Avalonia?

The best way to navigate between views in Avalonia is by using DataTemplates to map ViewModels to Views, ensuring proper View-ViewModel separation and modular component navigation across desktop UI scenarios.

Can I use RelayCommand for asynchronous actions in Avalonia MVVM?

Yes, you can use RelayCommand in Avalonia MVVM to handle both synchronous and asynchronous actions, including CanExecute logic to control when commands can be triggered in the UI.

Does Avalonia MVVM require CommunityToolkit.Mvvm for data binding?

While Avalonia supports data binding natively, using CommunityToolkit.Mvvm enforces robust MVVM patterns by streamlining property notification with [ObservableProperty] and command wiring for responsive desktop applications.

Why use [ObservableProperty] instead of manual INotifyPropertyChanged in Avalonia?

Use [ObservableProperty] in Avalonia to automatically generate property change notifications, reducing boilerplate code compared to manual INotifyPropertyChanged and streamlining ViewModel creation for responsive UIs.