diff --git a/src/Caliban.Nano/Data/Model.cs b/src/Caliban.Nano/Data/Model.cs index 18af08b..c10fdc7 100644 --- a/src/Caliban.Nano/Data/Model.cs +++ b/src/Caliban.Nano/Data/Model.cs @@ -1,5 +1,4 @@ -using System.ComponentModel; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using Caliban.Nano.Contracts; namespace Caliban.Nano.Data @@ -7,11 +6,8 @@ namespace Caliban.Nano.Data /// /// A base model. /// - public abstract partial class Model : IModel + public abstract partial class Model : NotifyBase, IModel { - /// - public event PropertyChangedEventHandler? PropertyChanged; - /// public bool HasChanged { get; protected set; } = false; @@ -69,11 +65,11 @@ protected virtual void Set(T value, [CallerMemberName] string? name = null, p _values[name] = value; } - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + NotifyPropertyChanged(name); foreach (var other in others) { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(other)); + NotifyPropertyChanged(other); } } }