> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class ObservableKeyedCollection<TKey, TItem>

Namespace: [VM.Collections](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections)\
Assembly: VM.dll

```csharp theme={null}
public class ObservableKeyedCollection<TKey, TItem> : ObservableKeyedCollectionBase<TKey, TItem>
```

#### Type Parameters

`TKey`

`TItem`

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[Collection\<TItem>](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1) ←
[KeyedCollection\<TKey, TItem>](https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.keyedcollection-2) ←
[ObservableKeyedCollectionBase\<TKey, TItem>](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md) ←
[ObservableKeyedCollection\<TKey, TItem>](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollection-2.md)

#### Inherited Members

[ObservableKeyedCollectionBase\<TKey, TItem>.AddRange(IEnumerable\<TItem>)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_AddRange_System_Collections_Generic_IEnumerable__1__),
[ObservableKeyedCollectionBase\<TKey, TItem>.TryGetValue(TKey, out TItem)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_TryGetValue__0__1__),
[ObservableKeyedCollectionBase\<TKey, TItem>.ClearItems()](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_ClearItems),
[ObservableKeyedCollectionBase\<TKey, TItem>.InsertItem(int, TItem)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_InsertItem_System_Int32__1_),
[ObservableKeyedCollectionBase\<TKey, TItem>.OnCollectionChanged(NotifyCollectionChangedEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_OnCollectionChanged_System_Collections_Specialized_NotifyCollectionChangedEventArgs_),
[ObservableKeyedCollectionBase\<TKey, TItem>.RemoveItem(int)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_RemoveItem_System_Int32_),
[ObservableKeyedCollectionBase\<TKey, TItem>.SetItem(int, TItem)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_SetItem_System_Int32__1_),
[ObservableKeyedCollectionBase\<TKey, TItem>.\<>OnPropertyChanged(PropertyChangedEventArgs)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2___OnPropertyChanged_System_ComponentModel_PropertyChangedEventArgs_),
[ObservableKeyedCollectionBase\<TKey, TItem>.CollectionChanged](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_CollectionChanged),
[ObservableKeyedCollectionBase\<TKey, TItem>.PropertyChanged](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Collections.ObservableKeyedCollectionBase-2.md#VM_Collections_ObservableKeyedCollectionBase_2_PropertyChanged)

#### Extension Methods

[LinkPropertyItemCache.GetLinkProperties(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkProperties_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkPropertiesAndValues(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkPropertiesAndValues_System_Object_VM_Models_Pre_LinkPropertyType_),
[LinkPropertyItemCache.GetLinkedObjects\<T>(object, LinkPropertyType)](https://developer.synopsys.com/docs/motion/motion-standalone-preprocessor-c-sharp-library/2025-r1/lib/VM.Models.Pre.Cache.LinkPropertyItemCache.md#VM_Models_Pre_Cache_LinkPropertyItemCache_GetLinkedObjects__1_System_Object_VM_Models_Pre_LinkPropertyType_)

## Constructors

### ObservableKeyedCollection(Func\<TItem, TKey>)

```csharp theme={null}
public ObservableKeyedCollection(Func<TItem, TKey> getKeyForItem)
```

#### Parameters

`getKeyForItem` [Func](https://learn.microsoft.com/dotnet/api/system.func-2)\<TItem, TKey>

## Methods

### GetKeyForItem(TItem)

```csharp theme={null}
protected override TKey GetKeyForItem(TItem item)
```

#### Parameters

`item` TItem

#### Returns

TKey
