blazor-mvvm

Implement Blazor MVVM patterns with ViewModels for UI state and business logic.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/spallempati/AI-Studio --skill blazor-mvvm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blazor-mvvm
Source: https://github.com/spallempati/AI-Studio/tree/main/skills/blazor/blazor-mvvm
Command: npx skills add https://github.com/spallempati/AI-Studio --skill blazor-mvvm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity of managing UI state and business logic within Blazor applications by enforcing the Model-View-ViewModel (MVVM) pattern, leading to more maintainable and testable code.

Core Features & Use Cases

  • Enforces MVVM: Guides developers on structuring ViewModels, separating UI state from components, and managing data flow.
  • Improves Testability: Promotes moving business logic into ViewModels for easier unit testing.
  • Defines Data Flow: Clearly outlines the architecture from Infrastructure to Razor components.
  • Use Case: When building a complex user profile form in Blazor, use this Skill to structure your UserProfileViewModel to handle all form state, validation, and data manipulation, keeping the Razor component clean and focused on presentation.

Quick Start

Implement the Blazor MVVM pattern by creating a ViewModel named UserProfileViewModel with properties for UI state and testable methods for business logic.

Frequently Asked Questions about blazor-mvvm

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

FAQPage Schema
How do I separate business logic from UI state in Blazor components?

Separate business logic from Blazor UI state by implementing the MVVM pattern, which moves data manipulation and validation into a dedicated ViewModel. This keeps Razor components focused on presentation and significantly improves code testability.

What is the best way to structure a Blazor MVVM ViewModel?

Structure a Blazor MVVM ViewModel by creating a class with properties for UI state and testable methods for business logic. This approach enforces separation of concerns and clearly defines data flow from infrastructure to the Razor component.

Does the Blazor MVVM pattern enforce specific architectural rules?

The Blazor MVVM pattern enforces specific architectural rules, including the 9 MVVM rules for separation of concerns. It defines a strict data flow architecture from infrastructure through the UI service layer to the Razor components.

When should I use the MVVM pattern in my Blazor application?

Use the MVVM pattern in Blazor when building complex UI forms or components that require strict separation of concerns. It is ideal for scenarios where you need to manage complex UI state, enforce testability, and maintain a clean data flow architecture.

How to implement data flow architecture in Blazor using MVVM?

Implement Blazor MVVM data flow by architecting a clear path from infrastructure through a UI service layer to the ViewModel, which then binds to the Razor component. This ensures clean state management and adheres to separation of concerns.