diff --git a/Stylet/PropertyChangedBase.cs b/Stylet/PropertyChangedBase.cs
index 4ec6118..7090f02 100644
--- a/Stylet/PropertyChangedBase.cs
+++ b/Stylet/PropertyChangedBase.cs
@@ -81,12 +81,18 @@ namespace Stylet
/// Field to assign
/// Value to assign to the field, if it differs
/// Name of the property to notify for. Defaults to the calling property
- protected virtual void SetAndNotify(ref T field, T value, [CallerMemberName] string propertyName = "")
+ /// True if field != value and a notification was raised; false otherwise
+ protected virtual bool SetAndNotify(ref T field, T value, [CallerMemberName] string propertyName = "")
{
if (!EqualityComparer.Default.Equals(field, value))
{
field = value;
this.NotifyOfPropertyChange(propertyName: propertyName);
+ return true;
+ }
+ else
+ {
+ return false;
}
}
}