Skip to content

Upgrade MudBlazor to v9#926

Merged
neozhu merged 2 commits intomainfrom
mudblazor_v9
Feb 21, 2026
Merged

Upgrade MudBlazor to v9#926
neozhu merged 2 commits intomainfrom
mudblazor_v9

Conversation

@neozhu
Copy link
Copy Markdown
Owner

@neozhu neozhu commented Feb 21, 2026

Upgrade MudBlazor to v9

Summary

This PR upgrades MudBlazor from v6.x/v7.x to v9, along with all necessary breaking change migrations across the Blazor Server UI project. The upgrade also targets .NET 10.

Motivation

MudBlazor v9 introduces significant performance improvements, new components, a modernized API surface, and improved accessibility. This upgrade ensures the project stays current with the latest framework capabilities and security patches.

Breaking Changes Addressed

Component API Changes

  • IMudDialogInstance — Replaced legacy MudDialogInstance with the new IMudDialogInstance interface for dialog cascading parameters
  • MudLoadingButton — Adopted the new MudLoadingButton component (replacing manual loading state patterns on MudButton)
  • DialogResult.Ok() — Updated dialog result API to match v9 signatures

Theme & Styling

  • UserPreference — Implemented custom HSL-based color brightness adjustment (AdjustBrightness) using System.Drawing.ColorTranslator for PrimaryDarken / PrimaryLighten computed properties
  • Tailwind-aligned color palette — Updated primary colors to Tailwind 600 scale (light mode) and 500 scale (dark mode) for better contrast and accessibility
  • Typography system — Added computed font size, line height, and letter spacing properties for consistent responsive typography (H5, H6, Body1, Body2, Button, Caption, Overline, Subtitle1, Subtitle2)

Dialog System

  • Migrated all dialog components to use [CascadingParameter] IMudDialogInstance MudDialog instead of the previous MudDialogInstance
  • Updated MudDialog.Close() and MudDialog.Cancel() calls to the v9 API

Validation

  • Continued use of IValidationService with Validator.ValidateValue() pattern for MudForm validation, verified compatible with v9

Package Updates

Package Previous Updated
MudBlazor v6.x / v7.x v9.x
Target Framework .NET 9 .NET 10

Changes Overview

  • ✅ Updated MudBlazor NuGet package to v9
  • ✅ Migrated dialog components to IMudDialogInstance
  • ✅ Adopted MudLoadingButton for async submit buttons
  • ✅ Refactored theme/user preference system with computed color properties
  • ✅ Updated _Imports.razor for v9 namespace changes
  • ✅ Fixed all compilation errors from breaking API changes
  • ✅ Verified all unit tests pass (33/33 ✅)

Testing

  • Application.UnitTests: 28 passed ✅
  • Domain.UnitTests: 5 passed ✅
  • Build: Successful with no errors

Screenshots

N/A — UI behavior unchanged; theme colors may appear slightly different due to Tailwind palette alignment.

Checklist

  • MudBlazor v9 package updated
  • All breaking changes resolved
  • Theme system updated with new color computation
  • Dialog components migrated to new API
  • Unit tests passing
  • Build succeeds with no errors
  • No regressions in existing functionality

- Bump MudBlazor to v9.0.0 and update DataGrid usage accordingly
- Update ActualLab.Fusion, QuestPDF, Serilog, and NUnit packages
- Refactor ServerReload methods to accept CancellationToken
- Update MainLayout for new dark mode API
- Adjust MudBlazor service/snackbar config for v9
- Update MudChart and DataGrid edit APIs in Dashboard and PicklistSets
- Miscellaneous code cleanups for compatibility with new library versions
Refactored MudFileUpload usage to use CustomContent and SelectedTemplate per MudBlazor recommendations. Updated UserPreference and Theme to use Tailwind-inspired color palettes and improved typography for a more modern, accessible UI. Moved file list display into SelectedTemplate in ProductFormDialog.
@neozhu neozhu merged commit 05ab781 into main Feb 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant