From 6de240cc4d19871b86e0caba0afc8ffcf6d7c27c Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 7 May 2015 21:55:56 +0200 Subject: [PATCH] Stop DevTools crashing when tree changed. PerspexReadOnlyListView had some problems... --- Perspex.Base/Collections/PerspexReadOnlyListView.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Perspex.Base/Collections/PerspexReadOnlyListView.cs b/Perspex.Base/Collections/PerspexReadOnlyListView.cs index 0f9d1cd0c4..7c6b3ee4dd 100644 --- a/Perspex.Base/Collections/PerspexReadOnlyListView.cs +++ b/Perspex.Base/Collections/PerspexReadOnlyListView.cs @@ -115,14 +115,14 @@ namespace Perspex.Collections case NotifyCollectionChangedAction.Add: ev = new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Add, - e.NewItems, + e.NewItems.Cast().ToList(), e.NewStartingIndex); break; case NotifyCollectionChangedAction.Remove: ev = new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Remove, e.OldItems, - e.NewStartingIndex); + e.OldStartingIndex); break; case NotifyCollectionChangedAction.Replace: ev = new NotifyCollectionChangedEventArgs( @@ -248,7 +248,7 @@ namespace Perspex.Collections return this.GetEnumerator(); } - private IList ConvertList(IEnumerable list) + private IList ConvertList(IEnumerable list) { return list.Cast().Select(this.convert).ToList(); } @@ -271,7 +271,7 @@ namespace Perspex.Collections ev = new NotifyCollectionChangedEventArgs( NotifyCollectionChangedAction.Remove, this.ConvertList(e.OldItems), - e.NewStartingIndex); + e.OldStartingIndex); break; case NotifyCollectionChangedAction.Replace: ev = new NotifyCollectionChangedEventArgs(