ugly fix for the setter changed method

This commit is contained in:
Holger Börchers 2020-07-13 11:24:27 +02:00
parent 8c87abeb1d
commit 1cf692547f

View File

@ -43,8 +43,12 @@ namespace ModernWpfPlayground.MvvmStuff
if (predicate != null) keys = keys.Where(predicate);
foreach (var key in keys)
{
var currentValue = ObjectAccessor[key];
_values.Remove(key);
RaisePropertyChanged(key);
var newValue = ObjectAccessor[key];
if (Equals(currentValue, newValue)) continue;
_values.Add(key, currentValue);
ObjectAccessor[key] = newValue;
}
}