Build and debug Avalonia 11/12 .NET applications with XAML, compiled bindings, MVVM, custom controls, desktop lifetimes, and platform publishing.
MVVM Pattern for .NET
Implement the Model-View-ViewModel pattern in .NET applications with proper separation of concerns, data binding, commands, and testable ViewModels using MVVM Toolkit. USE FOR: implementing UI separation with Model-View-ViewModel; using MVVM Toolkit (CommunityToolkit.Mvvm) for ViewModels; designing testable UI architecture. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
Trigger On
- implementing UI separation with Model-View-ViewModel
- using MVVM Toolkit (CommunityToolkit.Mvvm) for ViewModels
- designing testable UI architecture
- handling commands, property changes, and messaging
- choosing between MVVM frameworks
Workflow
- Keep Views dumb — no business logic in code-behind
- Use data binding — connect View to ViewModel properties
- Commands for actions — handle user interactions via ICommand
- Inject dependencies — services go into ViewModel constructors
- Test ViewModels — they should be unit testable without UI
Deliver
- ViewModels that are fully unit testable
- Clean separation between UI and business logic
- Proper use of commands and data binding
- Messaging for loose coupling between components
Validate
- No business logic in code-behind files
- ViewModels don't reference View types
- Commands are used for all user actions
- Properties use ObservableProperty or equivalent
- Dependencies are injected, not created
- Unit tests cover ViewModel logic
Documentation
References
- `patterns.md` — ViewModel, command, navigation, and state patterns
- `anti-patterns.md` — Common mistakes and how to fix them
Related skills
Create, modify, debug, or review Windows Forms applications only when the request contains a concrete Windows Forms marker.
Build cross-platform .NET applications with Uno Platform targeting WebAssembly, iOS, Android, macOS, Linux, and Windows from a single XAML/C# codebase.
These are the skills our senior team ships with. Want us to build your system? Book a 15-min call.