Implement INotifyPropertyChanged

This commit is contained in:
Frank A. Krueger 2018-04-18 17:14:21 -07:00
parent 62533cd175
commit ac41e017d8
No known key found for this signature in database
GPG Key ID: 0471C67474FFE664
1 changed files with 5 additions and 1 deletions

View File

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