    

 ## On this page

  

 

 # Class ObservableHashSet&lt;T\\&gt;

 Last update: 09.03.2026 

<a id="VM_Collections_ObservableHashSet_1"></a>

Namespace: [VM.Collections](VM.Collections.md)  
Assembly: VM.dll

Represents an observable set of values.

```csharp
public sealed class ObservableHashSet<T> : HashSet<T>

```

#### Type Parameters

`T`

The type of elements in the hash set.

#### Inheritance

object ← HashSet&lt;T&gt; ← [ObservableHashSet&lt;T&gt;](VM.Collections.ObservableHashSet-1.md)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_), [LinkPropertyItemCache.GetLinkedObjects&lt;T&gt;(object, LinkPropertyType)](VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### <a id="VM_Collections_ObservableHashSet_1__ctor"></a> ObservableHashSet()

```csharp
public ObservableHashSet()

```

### <a id="VM_Collections_ObservableHashSet_1__ctor_System_Collections_Generic_IEnumerable__0__"></a> ObservableHashSet(IEnumerable&lt;T&gt;)

```csharp
public ObservableHashSet(IEnumerable<T> collection)

```

#### Parameters

`collection` IEnumerable&lt;T&gt;

### <a id="VM_Collections_ObservableHashSet_1__ctor_System_Collections_Generic_IEqualityComparer__0__"></a> ObservableHashSet(IEqualityComparer&lt;T&gt;)

```csharp
public ObservableHashSet(IEqualityComparer<T> comparer)

```

#### Parameters

`comparer` IEqualityComparer&lt;T&gt;

### <a id="VM_Collections_ObservableHashSet_1__ctor_System_Collections_Generic_IEnumerable__0__System_Collections_Generic_IEqualityComparer__0__"></a> ObservableHashSet(IEnumerable&lt;T&gt;, IEqualityComparer&lt;T&gt;)

```csharp
public ObservableHashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer)

```

#### Parameters

`collection` IEnumerable&lt;T&gt;

`comparer` IEqualityComparer&lt;T&gt;

## Methods

### <a id="VM_Collections_ObservableHashSet_1_Add__0_"></a> Add(T)

Adds the specified element to a set.

```csharp
public bool Add(T item)

```

#### Parameters

`item` T

The element to add to the set.

#### Returns

bool

true if the element is added to the  object; false if the element is already present.

### <a id="VM_Collections_ObservableHashSet_1_Clear"></a> Clear()

Removes all elements from a  object.

```csharp
public void Clear()

```

### <a id="VM_Collections_ObservableHashSet_1_Dispose"></a> Dispose()

```csharp
public void Dispose()

```

### <a id="VM_Collections_ObservableHashSet_1_ExceptWith_System_Collections_Generic_IEnumerable__0__"></a> ExceptWith(IEnumerable&lt;T&gt;)

Removes all elements in the specified collection from the current  object.

```csharp
public void ExceptWith(IEnumerable<T> other)

```

#### Parameters

`other` IEnumerable&lt;T&gt;

The collection of items to remove from the  object.

### <a id="VM_Collections_ObservableHashSet_1_IntersectWith_System_Collections_Generic_IEnumerable__0__"></a> IntersectWith(IEnumerable&lt;T&gt;)

Modifies the current  object to contain only elements that are present in that object and in the specified collection.

```csharp
public void IntersectWith(IEnumerable<T> other)

```

#### Parameters

`other` IEnumerable&lt;T&gt;

The collection to compare to the current  object.

### <a id="VM_Collections_ObservableHashSet_1_Remove__0_"></a> Remove(T)

Removes the specified element from a  object.

```csharp
public bool Remove(T item)

```

#### Parameters

`item` T

The element to remove.

#### Returns

bool

true if the element is successfully found and removed; otherwise, false. This method returns false if item is not found in the  object.

### <a id="VM_Collections_ObservableHashSet_1_Reset"></a> Reset()

```csharp
public void Reset()

```

### <a id="VM_Collections_ObservableHashSet_1_SymmetricExceptWith_System_Collections_Generic_IEnumerable__0__"></a> SymmetricExceptWith(IEnumerable&lt;T&gt;)

Modifies the current  object to contain only elements that are present either in that object or in the specified collection, but not both.

```csharp
public void SymmetricExceptWith(IEnumerable<T> other)

```

#### Parameters

`other` IEnumerable&lt;T&gt;

The collection to compare to the current  object.

### <a id="VM_Collections_ObservableHashSet_1_UnionWith_System_Collections_Generic_IEnumerable__0__"></a> UnionWith(IEnumerable&lt;T&gt;)

Modifies the current  object to contain all elements that are present in itself, the specified collection, or both.

```csharp
public void UnionWith(IEnumerable<T> other)

```

#### Parameters

`other` IEnumerable&lt;T&gt;

The collection to compare to the current  object.

### <a id="VM_Collections_ObservableHashSet_1_CollectionChanged"></a> CollectionChanged

```csharp
public event NotifyCollectionChangedEventHandler CollectionChanged

```

#### Event Type

NotifyCollectionChangedEventHandler