wpf-devexpress-mvvm

Build WPF view models with the DevExpress MVVM Framework using generators, commands, services, and behaviors.

Updated Dec 11, 2025
One-click install
npx skills add https://github.com/AleksaRistic216/dotnet-playground --skill wpf-devexpress-mvvm-aleksaristic216
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wpf-devexpress-mvvm
Source: https://github.com/AleksaRistic216/dotnet-playground/tree/main/.github/skills/wpf/wpf-devexpress-mvvm
Command: npx skills add https://github.com/AleksaRistic216/dotnet-playground --skill wpf-devexpress-mvvm-aleksaristic216

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? WPF developers using the DevExpress MVVM Framework must choose between four view-model strategies, wire commands and INotifyPropertyChanged boilerplate, call UI services without code-behind, and pass data between view models — each with different C#/.NET version requirements and failure modes. This Skill guides those decisions and provides correct, working code patterns for every strategy. ## Core Features & Use Cases - View-Model Strategy Selection: Compares compile-time [GenerateViewModel], runtime POCO via ViewModelSource, ViewModelBase, and BindableBase with a requirements matrix covering C# version, .NET target, and VB support. - Commands, Services, and Behaviors: Covers DelegateCommand/AsyncCommand wiring, 25+ predefined services (IMessageBoxService, IDialogService, IDispatcherService, etc.) resolved via GetService<T>(), and behaviors like EventToCommand and KeyToCommand that replace code-behind. - View-Model Communication: Explains ISupportParameter, ISupportParentViewModel with ServiceSearchMode.PreferParents, and Messenger pub/sub including the weak-reference pitfall. - Use Case: A developer building a master-detail WPF app on .NET 8 uses the compile-time generator for view models, shows confirmation dialogs from a child view model via the parent window's DXMessageBoxService, and routes grid double-clicks to an EditCommand with EventToCommand — all without code-behind. ## Quick Start Ask the assistant to create a new WPF view model using the DevExpress compile-time GenerateViewModel attribute with a bindable property and a command wired to a button in XAML.

Frequently Asked Questions about wpf-devexpress-mvvm

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

FAQPage Schema
How do I create a view model with the DevExpress MVVM Framework in WPF?

For new projects, install DevExpress.Mvvm.CodeGenerators, mark a partial class with [GenerateViewModel], annotate fields with [GenerateProperty] and methods with [GenerateCommand]. The source generator emits INotifyPropertyChanged and command boilerplate at compile time.

Compile-time GenerateViewModel vs ViewModelSource POCO vs ViewModelBase — which should I use?

Use compile-time [GenerateViewModel] for new C# 9+ projects since it is debuggable and has no runtime cost. Use runtime POCO for VB.NET or older runtimes, and ViewModelBase when an existing codebase already inherits from it.

How do I show a message box from a view model without code-behind?

Register DXMessageBoxService in the view's dxmvvm:Interaction.Behaviors collection, then resolve IMessageBoxService in the view model via GetService<IMessageBoxService>() and call ShowMessage inside a command.

Does DevExpress MVVM compile-time generation work on .NET Framework?

Yes, on .NET Framework 4.6.1+ with C# 9 and Visual Studio 16.9+. In PackageReference-style projects you may need to reference the analyzer DLL directly; packages.config projects wire it automatically.

Why does GetService<T>() return null in my view model?

The service is not registered in the view's Interaction.Behaviors collection, is registered on the wrong view, or the view model does not implement ISupportServices. For compile-time view models, set ImplementISupportServices = true on [GenerateViewModel].

Why does my Messenger.Default handler stop firing?

Messenger.Default holds weak references to recipients, so garbage-collected view models stop receiving messages silently. Keep the recipient alive as a long-lived view model and register instance methods rather than anonymous lambdas.