diff --git a/Ooui/EventTarget.cs b/Ooui/EventTarget.cs index 84ee2f0..c2bee13 100644 --- a/Ooui/EventTarget.cs +++ b/Ooui/EventTarget.cs @@ -2,11 +2,12 @@ using System; using System.Collections.Generic; using System.Linq; using System.Reflection; +using System.ComponentModel; namespace Ooui { [Newtonsoft.Json.JsonConverter (typeof (EventTargetJsonConverter))] - public abstract class EventTarget + public abstract class EventTarget : INotifyPropertyChanged { readonly List stateMessages = new List (); @@ -17,6 +18,8 @@ namespace Ooui public string TagName { get; private set; } + public event PropertyChangedEventHandler PropertyChanged; + public event Action MessageSent; public IReadOnlyList StateMessages { @@ -96,6 +99,7 @@ namespace Ooui protected virtual void OnPropertyChanged (string propertyName) { + PropertyChanged?.Invoke (this, new PropertyChangedEventArgs (propertyName)); } public const char IdPrefix = '\u2999';