Describe the issue
Nullable property always OnPropertyChanged or OnPropertyChanging on
Fody Version=6.6.3
PropertyChanged.Fody Version=4.0.3
PropertyChanging.Fody Version=1.30.2
but works correctly on
Fody Version=6.0.0
PropertyChanged.Fody Version=3.1.3
PropertyChanging.Fody Version=1.30.0
Minimal Repro
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.6.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="4.0.3" />
<PackageReference Include="PropertyChanging.Fody" Version="1.30.2" />
</ItemGroup>
Сase 1:
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanging />
<PropertyChanged />
</Weavers>
public virtual void set_Birthday(DateTime? value)
{
if (!Nullable.Equals<DateTime>(this.Birthday, value))
{
this.OnPropertyChanging("Birthday");
this.<Birthday>k__BackingField = value;
}
this.OnPropertyChanged("Birthday"); // <-- !!! Changed always
}
public virtual void set_Birthday2(DateTime value)
{
if (!DateTime.Equals(this.<Birthday2>k__BackingField, value))
{
this.OnPropertyChanging("Birthday2");
this.<Birthday2>k__BackingField = value;
this.OnPropertyChanged("Birthday2");
}
}
Сase 2: Swap PropertyChanging and PropertyChanged
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
<PropertyChanging />
</Weavers>
public virtual void set_Birthday(DateTime? value)
{
this.OnPropertyChanging("Birthday"); // <-- !!! Changing always
if (!Nullable.Equals<DateTime>(this.Birthday, value))
{
this.<Birthday>k__BackingField = value;
this.OnPropertyChanged("Birthday");
}
}
public virtual void set_Birthday2(DateTime value)
{
if (!DateTime.Equals(this.<Birthday2>k__BackingField, value))
{
this.OnPropertyChanging("Birthday2");
this.<Birthday2>k__BackingField = value;
this.OnPropertyChanged("Birthday2");
}
}
Describe the issue
Nullable property always OnPropertyChanged or OnPropertyChanging on
Fody Version=6.6.3
PropertyChanged.Fody Version=4.0.3
PropertyChanging.Fody Version=1.30.2
but works correctly on
Fody Version=6.0.0
PropertyChanged.Fody Version=3.1.3
PropertyChanging.Fody Version=1.30.0
Minimal Repro
Сase 1:
Сase 2: Swap PropertyChanging and PropertyChanged