Skip to content

Repository files navigation

Blazing.Mvvm logo

Blazing.Mvvm

CI/CD

Blazing.Mvvm Blazing.Mvvm.Analyzers Downloads

🔥 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.

Quick Start

1. Install the package

dotnet add package Blazing.Mvvm

2. 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.

Documentation

Full documentation, guides, samples, analyzer rules, and the API reference are available on the documentation site.

Share Your Feedback

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.

Contributing

Refer to the Contributing guide for more details.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

🔥 Blazing.Mvvm - Full MVVM support for Blazor with CommunityToolkit.Mvvm integration. Supports all hosting models (Server, WASM, SSR, Auto, Hybrid, MAUI). Features strongly-typed navigation, automatic ViewModel registration, parameter resolution, validation support, and comprehensive lifecycle management. Includes samples and full documentation.

Topics

Resources

Code of conduct

Contributing

Stars

94 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages