Do not inherit from INPC if not needed
MODIFY
WalletWasabi.Fluent.Generators/AutoNotifyGenerator.cs
WalletWasabi.Fluent.Generators/AutoNotifyGenerator.cs
@@ -76,17 +76,29 @@ namespace WalletWasabi.Fluent
}
string namespaceName = classSymbol.ContainingNamespace.ToDisplayString();
+ bool addNotifyInterface = !classSymbol.Interfaces.Contains(notifySymbol);
- var source = new StringBuilder($@"// <auto-generated />
+ var source = new StringBuilder();
+
+ if (addNotifyInterface)
+ {
+ source.Append($@"// <auto-generated />
namespace {namespaceName}
{{
public partial class {classSymbol.Name} : {notifySymbol.ToDisplayString()}
{{
");
-
- if (!classSymbol.Interfaces.Contains(notifySymbol))
+ source.Append(
+ " public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;");
+ }
+ else
{
- source.Append(" public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;");
+ source.Append($@"// <auto-generated />
+namespace {namespaceName}
+{{
+ public partial class {classSymbol.Name}
+ {{
+");
}
foreach (IFieldSymbol fieldSymbol in fields)

Do not inherit from INPC if not needed