# C1.Win.Collections.ObjectModel.ObservableDictionary-2

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_Collections_ObjectModel_ObservableDictionary_2" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2" class="text-break">ObservableDictionary&lt;TKey, TValue&gt; Class
</h1>
  <div class="markdown level0 summary"><p>Represents a generic collection of key/value pairs that provides notifications when items get added, removed,
changed or when the whole list is refreshed.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.collection-1">Collection</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div class="level3"><span class="xref">ObservableDictionary&lt;TKey, TValue&gt;</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1">IList</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1">IReadOnlyList</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlycollection-1">IReadOnlyCollection</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="C1.Win.Collections.ObjectModel.ObservableKeyValuePair-2.html">ObservableKeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2">IDictionary</a>&lt;TKey, TValue&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1">IEnumerable</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;TKey, TValue&gt;&gt;</div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.Collections.ObjectModel.html">C1.Win.Collections.ObjectModel</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.10.dll</h6>
  <h5 id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ObservableDictionary&lt;TKey, TValue&gt; : ObservableCollection&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, IList&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, ICollection&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, IList, ICollection, IReadOnlyList&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, IReadOnlyCollection&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;, INotifyCollectionChanged, INotifyPropertyChanged, IDictionary&lt;TKey, TValue&gt;, ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class ObservableDictionary(Of TKey, TValue)
    Inherits ObservableCollection(Of ObservableKeyValuePair(Of TKey, TValue))
    Implements IList(Of ObservableKeyValuePair(Of TKey, TValue)), ICollection(Of ObservableKeyValuePair(Of TKey, TValue)), IList, ICollection, IReadOnlyList(Of ObservableKeyValuePair(Of TKey, TValue)), IReadOnlyCollection(Of ObservableKeyValuePair(Of TKey, TValue)), IEnumerable(Of ObservableKeyValuePair(Of TKey, TValue)), INotifyCollectionChanged, INotifyPropertyChanged, IDictionary(Of TKey, TValue), ICollection(Of KeyValuePair(Of TKey, TValue)), IEnumerable(Of KeyValuePair(Of TKey, TValue)), IEnumerable</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TKey</span></td>
        <td><p>The type of keys in the dictionary.</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TValue</span></td>
        <td><p>The type of values in the dictionary.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2__ctor" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.#ctor">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.-ctor.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2__ctor">ObservableDictionary()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_Item__0_" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.Item(`0)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.Item.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_Item__0_">this[TKey]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the element with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_Keys" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.Keys">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.Keys.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_Keys">Keys</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection&lt;T&gt;</a> containing the keys of the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_Values" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.Values">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.Values.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_Values">Values</a>
        </td>
        <td class="markdown level1 summary"><p>Gets an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1">ICollection&lt;T&gt;</a> containing the values in the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_Add__0__1_" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.Add(`0,`1)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.Add.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_Add__0__1_">Add(TKey, TValue)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds an element with the provided key and value to the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_ClearItems" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.ClearItems">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.ClearItems.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_ClearItems">ClearItems()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_ContainsKey__0_" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.ContainsKey(`0)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.ContainsKey.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_ContainsKey__0_">ContainsKey(TKey)</a>
        </td>
        <td class="markdown level1 summary"><p>Determines whether the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a> contains an element with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_GetEnumerator" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.GetEnumerator">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.GetEnumerator.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_GetEnumerator">GetEnumerator()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_InsertItem_System_Int32_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1__" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.InsertItem(System.Int32,C1.Win.Collections.ObjectModel.ObservableKeyValuePair{`0,`1})">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.InsertItem.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_InsertItem_System_Int32_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1__">InsertItem(int, ObservableKeyValuePair&lt;TKey, TValue&gt;)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_OnItemChanged_C1_Win_Collections_ObjectModel_ItemChangedEventArgs_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1___" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.OnItemChanged(C1.Win.Collections.ObjectModel.ItemChangedEventArgs{C1.Win.Collections.ObjectModel.ObservableKeyValuePair{`0,`1}})">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.OnItemChanged.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_OnItemChanged_C1_Win_Collections_ObjectModel_ItemChangedEventArgs_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1___">OnItemChanged(ItemChangedEventArgs&lt;ObservableKeyValuePair&lt;TKey, TValue&gt;&gt;)</a>
        </td>
        <td class="markdown level1 summary"><p>Fires the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.ItemChanged.html">ItemChanged</a> event.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_Remove__0_" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.Remove(`0)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.Remove.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_Remove__0_">Remove(TKey)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes the element with the specified key from the <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_RemoveItem_System_Int32_" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.RemoveItem(System.Int32)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.RemoveItem.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_RemoveItem_System_Int32_">RemoveItem(int)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_SetItem_System_Int32_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1__" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.SetItem(System.Int32,C1.Win.Collections.ObjectModel.ObservableKeyValuePair{`0,`1})">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.SetItem.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_SetItem_System_Int32_C1_Win_Collections_ObjectModel_ObservableKeyValuePair__0__1__">SetItem(int, ObservableKeyValuePair&lt;TKey, TValue&gt;)</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_TryGetValue__0__1__" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.TryGetValue(`0,`1@)">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.TryGetValue.html#C1_Win_Collections_ObjectModel_ObservableDictionary_2_TryGetValue__0__1__">TryGetValue(TKey, out TValue)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the value associated with the specified key.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_Collections_ObjectModel_ObservableDictionary_2_ItemChanged" data-uid="C1.Win.Collections.ObjectModel.ObservableDictionary`2.ItemChanged">
          <a class="xref" href="C1.Win.Collections.ObjectModel.ObservableDictionary-2.ItemChanged.html">ItemChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when a item value changes.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
