    

 ## On this page

  

 

 # Class ObservableKeyedCollectionBase&lt;TKey, TItem\\&gt;

 Last update: 16.07.2025 

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

```csharp
public abstract class ObservableKeyedCollectionBase<tkey titem> : KeyedCollection<tkey titem>

```

#### Type Parameters

`TKey`

`TItem`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ← [Collection](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1) ← [KeyedCollection](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2) ← [ObservableKeyedCollectionBase](VM.Collections.ObservableKeyedCollectionBase-2.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(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_ObservableKeyedCollectionBase_2__ctor"></a> ObservableKeyedCollectionBase()

```csharp
protected ObservableKeyedCollectionBase()

```

## Methods

### <a id="VM_Collections_ObservableKeyedCollectionBase_2___OnPropertyChanged_System_ComponentModel_PropertyChangedEventArgs_"></a> &amp;gt;OnPropertyChanged(PropertyChangedEventArgs)

```csharp
protected void &gt;OnPropertyChanged(PropertyChangedEventArgs eventArgs)

```

#### Parameters

`eventArgs` [PropertyChangedEventArgs](https://learn.microsoft.com/dotnet/api/system.componentmodel.propertychangedeventargs)

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_AddRange_System_Collections_Generic_IEnumerable__1__"></a> AddRange(IEnumerable)

```csharp
public void AddRange(IEnumerable<titem> items)

```

#### Parameters

`items` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_ClearItems"></a> ClearItems()

```csharp
protected override void ClearItems()

```

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_InsertItem_System_Int32__1_"></a> InsertItem(int, TItem)

```csharp
protected override void InsertItem(int index, TItem item)

```

#### Parameters

`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)

`item` TItem

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_OnCollectionChanged_System_Collections_Specialized_NotifyCollectionChangedEventArgs_"></a> OnCollectionChanged(NotifyCollectionChangedEventArgs)

```csharp
protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)

```

#### Parameters

`e` [NotifyCollectionChangedEventArgs](https://learn.microsoft.com/dotnet/api/system.collections.specialized.notifycollectionchangedeventargs)

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_RemoveItem_System_Int32_"></a> RemoveItem(int)

```csharp
protected override void RemoveItem(int index)

```

#### Parameters

`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_SetItem_System_Int32__1_"></a> SetItem(int, TItem)

```csharp
protected override void SetItem(int index, TItem newitem)

```

#### Parameters

`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)

`newitem` TItem

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_TryGetValue__0__1__"></a> TryGetValue(TKey, out TItem)

```csharp
public bool TryGetValue(TKey key, out TItem item)

```

#### Parameters

`key` TKey

`item` TItem

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

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

```csharp
public event NotifyCollectionChangedEventHandler CollectionChanged

```

#### Event Type

[NotifyCollectionChangedEventHandler](https://learn.microsoft.com/dotnet/api/system.collections.specialized.notifycollectionchangedeventhandler)

### <a id="VM_Collections_ObservableKeyedCollectionBase_2_PropertyChanged"></a> PropertyChanged

```csharp
public event PropertyChangedEventHandler PropertyChanged

```

#### Event Type

[PropertyChangedEventHandler](https://learn.microsoft.com/dotnet/api/system.componentmodel.propertychangedeventhandler)