loop on reset with range instead of clear

This commit is contained in:
Kyle Spearrin 2019-07-29 22:35:42 -04:00
parent 7a7ab7bd0e
commit 431804ea80
1 changed files with 10 additions and 1 deletions

View File

@ -30,7 +30,16 @@ namespace Bit.Core.Utilities
public void ResetWithRange(IEnumerable<T> 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);
}
}