Roslyn analyzers for WPF.
- 1.x versions are for Visual Studio 2015.
- 2.x versions are for Visual Studio 2017.
INPC001 | Implement INotifyPropertyChanged. |
INPC002 | Mutable public property should notify. |
INPC003 | Notify when property changes. |
INPC004 | Use [CallerMemberName] |
INPC005 | Check if value is different before notifying. |
INPC006_a | Check if value is different using ReferenceEquals before notifying. |
INPC006_b | Check if value is different using object.Equals before notifying. |
INPC007 | The class has PropertyChangedEvent but no invoker. |
INPC008 | Struct must not implement INotifyPropertyChanged |
INPC009 | Don't raise PropertyChanged for missing property. |
INPC010 | The property sets a different field than it returns. |
INPC011 | Don't shadow PropertyChanged event. |
INPC012 | Don't use expression for raising PropertyChanged. |
INPC013 | Use nameof. |
INPC014 | Prefer setting backing field in constructor. |
INPC015 | Property is recursive. |
INPC016 | Notify after update. |
The preferable way to use the analyzers is to add the nuget package PropertyChangedAnalyzers to the project(s).
The severity of individual rules may be configured using rule set files in Visual Studio 2015.
PropertyChangedAnalyzers can be installed using Paket or the NuGet command line or the NuGet Package Manager in Visual Studio 2015.
Install using the command line:
Install-Package PropertyChangedAnalyzers
The ruleset editor does not handle changes IDs well, if things get out of sync you can try:
- Close visual studio.
- Edit the ProjectName.rulset file and remove the PropertyChangedAnalyzers element.
- Start visual studio and add back the desired configuration.
Above is not ideal, sorry about this. Not sure this is our bug.
Early alpha, names and IDs may change.