Add index when calling NotifyCollectionChangeAction.Add

This commit is contained in:
弘韬 张 2021-01-21 19:51:22 +08:00
parent 1a758c3919
commit f388b75d26

View file

@ -267,12 +267,13 @@ namespace Flow.Launcher.ViewModel
}
private void AddAll(List<ResultViewModel> Items)
{
foreach (var item in Items)
for (int i = 0; i < Items.Count; i++)
{
var item = Items[i];
if (_token.IsCancellationRequested)
return;
Add(item);
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item));
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, i));
}
}
public void RemoveAll(int Capacity = 512)