some times we need notify Property changed manually, for example, notify Total when collection changed, in this case we do not call Total=xxx, just call OnPropertyChanged("Total"), this cause other property that reference Total can't raised, so can you don't generate this:
public string GivenNames
{
public string GivenNames
{
get => givenNames;
set
{
if (value != givenNames)
{
givenNames = value;
OnPropertyChanged(InternalEventArgsCache.GivenNames);
OnPropertyChanged(InternalEventArgsCache.FullName);
}
}
}
generate this:
public string GivenNames
{
get => givenNames;
set
{
if (value != givenNames)
{
givenNames = value;
OnPropertyChanged(InternalEventArgsCache.GivenNames);
}
}
}
void OnPropertyChanged(PropertyChangedEventArgs eventArgs)
{
PropertyChanged?.Invoke(this, eventArgs);
if (eventArgs == InternalEventArgsCache.GivenNames)
PropertyChanged?.Invoke(this, InternalEventArgsCache.FullName);
}
some times we need notify Property changed manually, for example, notify
Totalwhen collection changed, in this case we do not callTotal=xxx, just callOnPropertyChanged("Total"), this cause other property that referenceTotalcan't raised, so can you don't generate this:generate this: