using System; using System.Collections.Generic; using System.ComponentModel; using System.Runtime.CompilerServices; namespace ConfigureWindow.domain { public static class NotifyPropertyChangedExtension { public static bool MutateVerbose(this INotifyPropertyChanged _, ref TField field, TField newValue, Action raise, [CallerMemberName] string propertyName = null) { if (EqualityComparer.Default.Equals(field, newValue)) return false; field = newValue; raise?.Invoke(new PropertyChangedEventArgs(propertyName)); return true; } } }