ObservableFilterCollection - in 'reset(),' clear the target collection if source is empty

This commit is contained in:
John Colvin committed 2019-03-09 22:09:27 -06:00
1 parent c8cd2ae1ad
commit 36684f8ee5
1 file changed
+5 -1
@@ -87,7 +87,11 @@ namespace mbts.ui.utility {
foreach (var value in source_collection.OfType<INotifyPropertyChanged>())
value.PropertyChanged += on_item_PropertyChanged;
}
CollectionHelper.sync_with_never_duplicate(filtered_collection, source_collection.Where(filter));
if (source_collection.Count == 0) {
filtered_collection.Clear();
} else {
CollectionHelper.sync_with_never_duplicate(filtered_collection, source_collection.Where(filter));
}
}
}
}