Shipped
| Attribute | Generates |
|---|---|
| [Notify] / [NotifyAlso] | Property + changing/changed + dependents |
| [NotifyDependsOn] | Computed property notifies when named sources change — no Reactive package |
| [ModelCommand] / [AsyncModelCommand] | Command property + CanExecute hookup |
| [RegisterViewModel] / [RegisterView] | IServiceCollection + generated page maps |
| [Route] | Route table for Shell / navigator |
| [PersistState] | Save/restore members via IStateStore |
| [RequiresAuth] / [RequiresRole] | Guard metadata for INavigationAuthPolicy |
<PackageReference Include="Plugin.Maui.MVVMExpress.SourceGenerators" Version="1.3.0" PrivateAssets="all" />
builder.UseMvvmExpress(o => o
.UseNavigationPage()
.UseDialogs()
.UseAuth<LoginViewModel>());
// generated [Route] / [RegisterView] / [RequiresAuth] apply from UseMvvmExpress
services.AddGeneratedViewModels(); // optional explicit callConvention scan of *Page / *ViewModel is not a supported 1.3 registration path (MVVME010 in DEBUG). Typed NavigateToAsync<TViewModel>() and generated registrations are the supported story. Handwritten Map remains an escape hatch.
Analyzers
The SourceGenerators pack ships diagnostics. Zero false positives on the in-repo samples and the template is a 1.3 gate.
| ID | Severity | Rule |
|---|---|---|
| MVVME001 | Error | Shell.Current or Page.DisplayAlert inside a ViewModel / PageViewModel / ObservableModel |
| MVVME002 | Warning | this captured on a weak IMessageHub handler |
| MVVME003 | Warning | FormField created without Bind |
| MVVME010 | Error (DEBUG) | Convention *Page / *ViewModel reflection scan — generators + ModuleInitializer only |
| MVVME011 | Warning | ObservableRangeCollection.Add in a loop |
| MVVME012 | Warning | SnapshotCollection + BindableLayout |
| MVVME013 | Error | PagedCollection + sync fetch + RemainingItemsThreshold |