From 431804ea80df7d8a0d6408a77adbef240998cb1f Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 29 Jul 2019 22:35:42 -0400 Subject: [PATCH] loop on reset with range instead of clear --- src/Core/Utilities/ExtendedObservableCollection.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Core/Utilities/ExtendedObservableCollection.cs b/src/Core/Utilities/ExtendedObservableCollection.cs index 473e3c7b9..a49f37bfe 100644 --- a/src/Core/Utilities/ExtendedObservableCollection.cs +++ b/src/Core/Utilities/ExtendedObservableCollection.cs @@ -30,7 +30,16 @@ namespace Bit.Core.Utilities public void ResetWithRange(IEnumerable range) { - Items.Clear(); + // Maybe a fix for https://forums.xamarin.com/discussion/19114/invalid-number-of-rows-in-section + // Items.Clear(); + if(Items.Count > 0) + { + var count = Items.Count; + for(var i = 0; i < count; i++) + { + Items.RemoveAt(0); + } + } AddRange(range); } }