From 1cf692547fdcf2bb5116b4f896e2169ea37f8e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20B=C3=B6rchers?= Date: Mon, 13 Jul 2020 11:24:27 +0200 Subject: [PATCH] ugly fix for the setter changed method --- App/MvvmStuff/BaseViewModel.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/App/MvvmStuff/BaseViewModel.cs b/App/MvvmStuff/BaseViewModel.cs index 3da39e4..309bc92 100644 --- a/App/MvvmStuff/BaseViewModel.cs +++ b/App/MvvmStuff/BaseViewModel.cs @@ -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; } }