Original code from https://github.com/dotnet/roslyn-sdk/tree/main/samples/CSharp/SourceGenerators
[AutoNotify(CheckEquality = EqualityCheck.None, GetterVisibility = Visibility.Public, SetterVisibility = Visibility.Public)]
public partial class Filter
{
[AutoNotify]
private DateTime? _from;
[AutoNotify]
private DateTime? _to;
}
public partial class Filter : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public DateTime? From
{
get
{
return _from;
}
set
{
_from = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(From)));
}
}
public DateTime? To
{
get
{
return _to;
}
set
{
_to = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(To)));
}
}
}