🔥 Blazing.Mvvm brings full MVVM support to Blazor through seamless integration with the CommunityToolkit.Mvvm. It provides strongly-typed, ViewModel-first navigation, automatic ViewModel registration and discovery, parameter resolution between Views and ViewModels, validation with ObservableValidator, and comprehensive lifecycle management across every Blazor hosting model (Server, WebAssembly, Static SSR, Auto, Hybrid, and MAUI). It also ships Roslyn analyzers with one-click code fixes to catch common MVVM mistakes at build time.
1. Install the package
dotnet add package Blazing.Mvvm2. Register Blazing.Mvvm in Program.cs
builder.Services.AddMvvm(options =>
{
options.HostingModelType = BlazorHostingModelType.WebApp;
});3. Create a ViewModel
public partial class CounterViewModel : ViewModelBase
{
[ObservableProperty]
private int _count;
[RelayCommand]
private void Increment() => Count++;
}4. Use it in a component
@page "/counter"
@inherits MvvmComponentBase<CounterViewModel>
<p role="status">Current count: @ViewModel.Count</p>
<button class="btn btn-primary" @onclick="ViewModel.IncrementCommand.Execute">
Click me
</button>For the full walkthrough, including configuration options, ViewModel setup, and component usage, see the Getting Started guide.
Full documentation, guides, samples, analyzer rules, and the API reference are available on the documentation site.
If you like the library, use it, share it, and give it a ⭐️. For any suggestions, feature requests, or issues, feel free to create an issue to help improve the library.
Refer to the Contributing guide for more details.
This project is licensed under the MIT License. See the LICENSE file for details.
