From ac41e017d85696914b8ac5f06f985205bae17115 Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Wed, 18 Apr 2018 17:14:21 -0700 Subject: [PATCH] Implement INotifyPropertyChanged --- Ooui/EventTarget.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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';