Skip to content
georgepwall1991Public

About

Zero-runtime INotifyPropertyChanged source generator. [NotifyComputed] for derived properties; one-click convert from CommunityToolkit [ObservableProperty] (NOTIFY023).

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

NotifyGen Banner

NotifyGen Icon

NotifyGen

NuGet NuGet Downloads Build Status Coverage .NET License: MIT

Stop writing INotifyPropertyChanged boilerplate. Let the compiler do it.

Zero runtime reflection. No IL weaving. No required base class. Inspectable generated C# for WPF, MAUI, Avalonia, Uno, WinUI, and Blazor ViewModels.

NotifyGen binding demo: FirstName/LastName update FullName via NotifyAlso

Migrating from [ObservableProperty]?

Keep CommunityToolkit.Mvvm for RelayCommand / messaging. Use NotifyGen for properties — no required ObservableObject, zero runtime package.

Add NotifyGen, click the lightbulb on [ObservableProperty] (NOTIFY023), and Fix All. Unmarked _logger / _disposed fields stay private.

→ Migration checklist & attribute map · Hybrid UI sample

Quick start

dotnet add package NotifyGen
<PackageReference Include="NotifyGen" Version="2.2.1">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
using NotifyGen;

[Notify]
public partial class Person
{
    private string _firstName;
    private string _lastName;

    [NotifyComputed]
    public string FullName => $"{FirstName} {LastName}";
}

NotifyGen generates equality-guarded setters, PropertyChanged, and optional hooks:

partial void OnFirstNameChanged(string oldValue, string newValue);

Why NotifyGen

NotifyGen CommunityToolkit.Mvvm Fody.PropertyChanged
Runtime dependency None Toolkit runtime Weaver
Inspectable C# Yes Yes No (IL)
Required base class No (reuses host INPC) ObservableObject typical No
Scope Narrow INPC generator Full MVVM toolkit Property weaver

Recommended stack: NotifyGen for properties, CommunityToolkit for RelayCommand / messaging. See the hybrid sample.

Highlights

  • Field → property (_name → Name) and C# 14 partial-property mode
  • [NotifyComputed] wires derived properties from the getter (or an explicit DependsOn list)
  • [NotifyAlso] with transitive closure, target-side NotifyFrom, child INPC, and collection membership
  • Typed On{Property}Changed(old, new) hooks, changing events, suppressable bulk updates
  • Property / property: / get: / set: metadata forwarding
  • [NotifyProperty] opt-in (and CommunityToolkit [ObservableProperty] takeover) so mixed ViewModels do not publish _logger
  • Analyzer diagnostics NOTIFY001–NOTIFY023; code fixes for missing partial (NOTIFY001 / NOTIFY006), underscore field names (NOTIFY002), unknown [NotifyAlso] names (NOTIFY003), and CommunityToolkit conversion (NOTIFY022 / NOTIFY023)

Docs

Requirements

  • .NET Standard 2.0+ consumers; Roslyn 4.8+ / modern .NET SDK for generation
  • C# 14 / preview language version for incomplete partial-property mode

License

MIT — see LICENSE.

About

Zero-runtime INotifyPropertyChanged source generator. [NotifyComputed] for derived properties; one-click convert from CommunityToolkit [ObservableProperty] (NOTIFY023).

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages