From ee8d88146fc715e3ab60f3c35a6fa4a29417ca40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Erbsh=C3=A4u=C3=9Fer?= Date: Thu, 18 Jun 2020 17:14:26 +0200 Subject: [PATCH] Fixed minor bug in recently opened files list where changes were not reflected in UI. --- ucalc/Data/RecentlyOpened.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ucalc/Data/RecentlyOpened.cs b/ucalc/Data/RecentlyOpened.cs index dc30b1e..56f912c 100644 --- a/ucalc/Data/RecentlyOpened.cs +++ b/ucalc/Data/RecentlyOpened.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.Specialized; using System.IO; using System.Linq; @@ -40,7 +41,7 @@ namespace UCalc.Data } } - public class RecentlyOpenedList : ICollection + public class RecentlyOpenedList : ICollection, INotifyCollectionChanged { private const int MaxCount = 10; private readonly string _path; @@ -79,6 +80,8 @@ namespace UCalc.Data { // Do nothing } + + CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } public IEnumerator GetEnumerator() @@ -136,5 +139,6 @@ namespace UCalc.Data public int Count => _list.Count; public bool IsReadOnly => false; + public event NotifyCollectionChangedEventHandler CollectionChanged; } } \ No newline at end of file