diff --git a/src/ObservableCollections/ObservableHashSet.cs b/src/ObservableCollections/ObservableHashSet.cs index 8e2e1d4..655ecf2 100644 --- a/src/ObservableCollections/ObservableHashSet.cs +++ b/src/ObservableCollections/ObservableHashSet.cs @@ -14,23 +14,23 @@ namespace ObservableCollections readonly HashSet set; public object SyncRoot { get; } = new object(); - public ObservableHashSet() + public ObservableHashSet(IEqualityComparer? comparer = null) { - this.set = new HashSet(); + this.set = new HashSet(comparer: comparer); } #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER - public ObservableHashSet(int capacity) + public ObservableHashSet(int capacity, IEqualityComparer? comparer = null) { - this.set = new HashSet(capacity); + this.set = new HashSet(capacity: capacity, comparer: comparer); } #endif - public ObservableHashSet(IEnumerable collection) + public ObservableHashSet(IEnumerable collection, IEqualityComparer? comparer = null) { - this.set = new HashSet(collection); + this.set = new HashSet(collection: collection, comparer: comparer); } public event NotifyCollectionChangedEventHandler? CollectionChanged;