From 36684f8ee55e28d079367bf32dc773dad1688374 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sat, 9 Mar 2019 21:29:49 -0600 Subject: [PATCH] ObservableFilterCollection - in 'reset(),' clear the target collection if source is empty --- .../spark/core/Collections/ObservableFilterCollection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/spark/core/Collections/ObservableFilterCollection.cs b/src/client/spark/core/Collections/ObservableFilterCollection.cs index 9f6760db1..5f6baba1d 100644 --- a/src/client/spark/core/Collections/ObservableFilterCollection.cs +++ b/src/client/spark/core/Collections/ObservableFilterCollection.cs @@ -87,7 +87,11 @@ namespace mbts.ui.utility { foreach (var value in source_collection.OfType()) 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)); + } } } }