# GrapeCity.Documents.Common.ObservableDictionary-2

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Common_ObservableDictionary_2" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2" class="text-break">ObservableDictionary&lt;TKey, TValue&gt; Class
</h1>
  <div class="markdown level0 summary"><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary&lt;TKey, TValue&gt;</a> supporting <span class="xref">GrapeCity.Documents.Common.IObservableCollectionEx</span> interface.</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"><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.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.idictionary">IDictionary</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlydictionary-2">IReadOnlyDictionary</a>&lt;TKey, TValue&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="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.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.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Common.html">GrapeCity.Documents.Common</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Imaging.dll</h6>
  <h5 id="GrapeCity_Documents_Common_ObservableDictionary_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class ObservableDictionary&lt;TKey, TValue&gt; : IDictionary&lt;TKey, TValue&gt;, ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IDictionary, IReadOnlyDictionary&lt;TKey, TValue&gt;, IReadOnlyCollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, IList, ICollection, IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class ObservableDictionary(Of TKey, TValue)
    Implements IDictionary(Of TKey, TValue), ICollection(Of KeyValuePair(Of TKey, TValue)), IDictionary, IReadOnlyDictionary(Of TKey, TValue), IReadOnlyCollection(Of KeyValuePair(Of TKey, TValue)), IEnumerable(Of KeyValuePair(Of TKey, TValue)), IList, ICollection, 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 the keys in the dictionary.</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TValue</span></td>
        <td><p>The type of the 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="GrapeCity_Documents_Common_ObservableDictionary_2__ctor" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.#ctor">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.-ctor.html#GrapeCity_Documents_Common_ObservableDictionary_2__ctor">ObservableDictionary()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2__ctor_System_Collections_Generic_IEqualityComparer__0__" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.#ctor(System.Collections.Generic.IEqualityComparer{`0})">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.-ctor.html#GrapeCity_Documents_Common_ObservableDictionary_2__ctor_System_Collections_Generic_IEqualityComparer__0__">ObservableDictionary(IEqualityComparer&lt;TKey&gt;)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_m_Items" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.m_Items">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.m_Items.html">m_Items</a>
        </td>
        <td class="markdown level1 summary"><p>The underlying <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2">Dictionary&lt;TKey, TValue&gt;</a>.</p>
</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="GrapeCity_Documents_Common_ObservableDictionary_2_Changed" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Changed">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Changed.html#GrapeCity_Documents_Common_ObservableDictionary_2_Changed">Changed</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether the list was changed.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Count" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Count">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Count.html#GrapeCity_Documents_Common_ObservableDictionary_2_Count">Count</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the number of key/value pairs contained in the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sorteddictionary-2">SortedDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Item__0_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Item(`0)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Item.html#GrapeCity_Documents_Common_ObservableDictionary_2_Item__0_">this[TKey]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the value associated with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Keys" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Keys">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Keys.html#GrapeCity_Documents_Common_ObservableDictionary_2_Keys">Keys</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a collection containing the keys in the <a class="xref" href="GrapeCity.Documents.Common.ObservableSortedDictionary-2.html">ObservableSortedDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Values" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Values">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Values.html#GrapeCity_Documents_Common_ObservableDictionary_2_Values">Values</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a collection containing the values in the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.sorteddictionary-2">SortedDictionary&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="GrapeCity_Documents_Common_ObservableDictionary_2_Add__0__1_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Add(`0,`1)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Add.html#GrapeCity_Documents_Common_ObservableDictionary_2_Add__0__1_">Add(TKey, TValue)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds an element with the specified key and value into the <a class="xref" href="GrapeCity.Documents.Common.ObservableSortedDictionary-2.html">ObservableSortedDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_AddItem__0__1_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.AddItem(`0,`1)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.AddItem.html#GrapeCity_Documents_Common_ObservableDictionary_2_AddItem__0__1_">AddItem(TKey, TValue)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds an element into collection with specified key.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Clear" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Clear">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Clear.html#GrapeCity_Documents_Common_ObservableDictionary_2_Clear">Clear()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all elements from the <a class="xref" href="GrapeCity.Documents.Common.ObservableSortedDictionary-2.html">ObservableSortedDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_ClearItems" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.ClearItems">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.ClearItems.html#GrapeCity_Documents_Common_ObservableDictionary_2_ClearItems">ClearItems()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all elements from the collection.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_ContainsKey__0_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.ContainsKey(`0)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.ContainsKey.html#GrapeCity_Documents_Common_ObservableDictionary_2_ContainsKey__0_">ContainsKey(TKey)</a>
        </td>
        <td class="markdown level1 summary"><p>Determines whether the <a class="xref" href="GrapeCity.Documents.Common.ObservableSortedDictionary-2.html">ObservableSortedDictionary&lt;TKey, TValue&gt;</a> contains an element with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_OnChanged" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.OnChanged">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.OnChanged.html#GrapeCity_Documents_Common_ObservableDictionary_2_OnChanged">OnChanged()</a>
        </td>
        <td class="markdown level1 summary"><p>Called when dictionary was changed, sets <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Changed.html#GrapeCity_Documents_Common_ObservableDictionary_2_Changed">Changed</a> to true.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_Remove__0_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.Remove(`0)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.Remove.html#GrapeCity_Documents_Common_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="GrapeCity.Documents.Common.ObservableSortedDictionary-2.html">ObservableSortedDictionary&lt;TKey, TValue&gt;</a>.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_RemoveItem__0_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.RemoveItem(`0)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.RemoveItem.html#GrapeCity_Documents_Common_ObservableDictionary_2_RemoveItem__0_">RemoveItem(TKey)</a>
        </td>
        <td class="markdown level1 summary"><p>Removes an element with specified key.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_SetItem__0__1_" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.SetItem(`0,`1)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.SetItem.html#GrapeCity_Documents_Common_ObservableDictionary_2_SetItem__0__1_">SetItem(TKey, TValue)</a>
        </td>
        <td class="markdown level1 summary"><p>Replaces the element with the specified key.</p>
</td>
      </tr>
      <tr>
        <td id="GrapeCity_Documents_Common_ObservableDictionary_2_TryGetValue__0__1__" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.TryGetValue(`0,`1@)">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.TryGetValue.html#GrapeCity_Documents_Common_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="GrapeCity_Documents_Common_ObservableDictionary_2_DictionaryChanged" data-uid="GrapeCity.Documents.Common.ObservableDictionary`2.DictionaryChanged">
          <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.DictionaryChanged.html">DictionaryChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Raised when the <a class="xref" href="GrapeCity.Documents.Common.ObservableDictionary-2.html">ObservableDictionary&lt;TKey, TValue&gt;</a> is changed.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
