<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Can I bind my ItemsControl to a dictionary?</title>
	<atom:link href="http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/feed/" rel="self" type="application/rss+xml" />
	<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/</link>
	<description>Drinking (and serving) the WPF Kool-Aid since 2002</description>
	<lastBuildDate>Fri, 12 Mar 2010 01:06:24 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dr. WPF</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-743</link>
		<dc:creator>Dr. WPF</dc:creator>
		<pubDate>Fri, 12 Mar 2010 01:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-743</guid>
		<description>I&#039;ve updated the dictionary to fix a couple of bugs:

First, there&#039;s the infinitely recursive call that Marc pointed out in his comment above.  (Who writes this crap?)

Second, I fixed the issue that Pete found with not raising the change notification for &quot;Item[]&quot; when a set occurs (see pingback comment above).  This was actually a regression from an earlier fix. Doh! :o  (Seriously, doesn&#039;t anyone unit test these things!?)

Big thanks to Pete and Marc!  :D</description>
		<content:encoded><![CDATA[<p>I&#8217;ve updated the dictionary to fix a couple of bugs:</p>
<p>First, there&#8217;s the infinitely recursive call that Marc pointed out in his comment above.  (Who writes this crap?)</p>
<p>Second, I fixed the issue that Pete found with not raising the change notification for &#8220;Item[]&#8221; when a set occurs (see pingback comment above).  This was actually a regression from an earlier fix. Doh! <img src='http://drwpf.com/blog/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' />   (Seriously, doesn&#8217;t anyone unit test these things!?)</p>
<p>Big thanks to Pete and Marc!  <img src='http://drwpf.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binding to a Dictionary in WPF and Silverlight - Pete Brown's 10rem.net</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-742</link>
		<dc:creator>Binding to a Dictionary in WPF and Silverlight - Pete Brown's 10rem.net</dc:creator>
		<pubDate>Thu, 11 Mar 2010 21:10:56 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-742</guid>
		<description>[...] community has come up with a few implementations of an ObservableDictionary. This link is to one of the good ones, by Dr. WPF. Here is another ObservableDictionary on codeplex. Unfortunately, the first works only for [...]</description>
		<content:encoded><![CDATA[<p>[...] community has come up with a few implementations of an ObservableDictionary. This link is to one of the good ones, by Dr. WPF. Here is another ObservableDictionary on codeplex. Unfortunately, the first works only for [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marc Messing</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-711</link>
		<dc:creator>Marc Messing</dc:creator>
		<pubDate>Sun, 21 Feb 2010 17:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-711</guid>
		<description>Hi, 

thx for the great work. 
With VS 2010RC1 I got a Stackoverflow in Line 445. Replacing the Line with
get { return ((IDictionary&lt;TKey, TValue&gt;)this)[(TKey)key]; }
helped. 

Marc</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>thx for the great work.<br />
With VS 2010RC1 I got a Stackoverflow in Line 445. Replacing the Line with<br />
get { return ((IDictionary&lt;TKey, TValue&gt;)this)[(TKey)key]; }<br />
helped. </p>
<p>Marc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SteveO</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-668</link>
		<dc:creator>SteveO</dc:creator>
		<pubDate>Sat, 06 Feb 2010 19:39:54 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-668</guid>
		<description>Dr. WPF,

Thanks for the class! Saved me a lot of time. One thing, I&#039;m using it in VS 2010 B2 and get 3 CS0693 warnings. These look like BS warnings to me, but apperently Microsoft decided you can&#039;t use the same names for inner template params as you do for the outer ones. The warnings are because you named all the collection params as TKey and TValue.</description>
		<content:encoded><![CDATA[<p>Dr. WPF,</p>
<p>Thanks for the class! Saved me a lot of time. One thing, I&#8217;m using it in VS 2010 B2 and get 3 CS0693 warnings. These look like BS warnings to me, but apperently Microsoft decided you can&#8217;t use the same names for inner template params as you do for the outer ones. The warnings are because you named all the collection params as TKey and TValue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr. WPF</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-633</link>
		<dc:creator>Dr. WPF</dc:creator>
		<pubDate>Wed, 20 Jan 2010 11:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-633</guid>
		<description>Hi Rafal,

My implementation of the ObservableDictionary class includes all of the interfaces implemented by the native Dictionary class in the full .NET framework.  Silverlight uses a compact version of the .NET framework.  The CoreCLR for Silverlight defines the Dictionary class as follows:

&lt;pre&gt;&lt;code&gt;public class Dictionary&lt;TKey, TValue&gt; : 
    IDictionary&lt;TKey, TValue&gt;, 
    ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;,
    IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;, 
    IDictionary, 
    ICollection, 
    IEnumerable&lt;/code&gt;&lt;/pre&gt;

Note that the serialization interfaces simply don&#039;t exist in Silverlight&#039;s CoreCLR.  This means you can create an ObservableDictionary for Silverlight that is fully analogous to the native Dictionary class without supporting serialization.

Of course, if you actually need to serialize the dictionary (for storage, remoting, etc), then I see no problem with using the XML serialization interfaces. :)

Cheers,
-dw</description>
		<content:encoded><![CDATA[<p>Hi Rafal,</p>
<p>My implementation of the ObservableDictionary class includes all of the interfaces implemented by the native Dictionary class in the full .NET framework.  Silverlight uses a compact version of the .NET framework.  The CoreCLR for Silverlight defines the Dictionary class as follows:</p>
<pre><code>public class Dictionary&lt;TKey, TValue&gt; :
    IDictionary&lt;TKey, TValue&gt;,
    ICollection&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;,
    IEnumerable&lt;KeyValuePair&lt;TKey, TValue&gt;&gt;,
    IDictionary,
    ICollection,
    IEnumerable</code></pre>
<p>Note that the serialization interfaces simply don&#8217;t exist in Silverlight&#8217;s CoreCLR.  This means you can create an ObservableDictionary for Silverlight that is fully analogous to the native Dictionary class without supporting serialization.</p>
<p>Of course, if you actually need to serialize the dictionary (for storage, remoting, etc), then I see no problem with using the XML serialization interfaces. <img src='http://drwpf.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers,<br />
-dw</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rafal</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-631</link>
		<dc:creator>Rafal</dc:creator>
		<pubDate>Tue, 19 Jan 2010 14:26:01 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-631</guid>
		<description>hi Dr.WPF,

wow since 2007 (when you wrote it) has now more than 2 years passed by and I can even now after so many years use your great class. I am trying to use your Observabledictionary under silverlight 3. MS didn&#039;t make any improvements in this field since ver.2. I&#039;ve noticed that the ISerializable and IDeserializable are not supported in SL. So your serialization part doesn’t work in SL.
My question is. If I replace not working Ser/DeSer code with IXmlSerializable and methods like write-/readXML would it be enough? 

Thanks for your great work
Rafal</description>
		<content:encoded><![CDATA[<p>hi Dr.WPF,</p>
<p>wow since 2007 (when you wrote it) has now more than 2 years passed by and I can even now after so many years use your great class. I am trying to use your Observabledictionary under silverlight 3. MS didn&#8217;t make any improvements in this field since ver.2. I&#8217;ve noticed that the ISerializable and IDeserializable are not supported in SL. So your serialization part doesn’t work in SL.<br />
My question is. If I replace not working Ser/DeSer code with IXmlSerializable and methods like write-/readXML would it be enough? </p>
<p>Thanks for your great work<br />
Rafal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr. WPF</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-518</link>
		<dc:creator>Dr. WPF</dc:creator>
		<pubDate>Fri, 11 Dec 2009 19:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-518</guid>
		<description>Hi Chip,

You should be able to cast the dictionary to INotifyCollectionChanged to add the handler:

(aDict as INotifyCollectionChanged).CollectionChanged += ...

Cheers,
-dw</description>
		<content:encoded><![CDATA[<p>Hi Chip,</p>
<p>You should be able to cast the dictionary to INotifyCollectionChanged to add the handler:</p>
<p>(aDict as INotifyCollectionChanged).CollectionChanged += &#8230;</p>
<p>Cheers,<br />
-dw</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chip</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-517</link>
		<dc:creator>Chip</dc:creator>
		<pubDate>Fri, 11 Dec 2009 16:38:52 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-517</guid>
		<description>I&#039;d like to register to get the change events directly. The following code is what I am attempting, but the collectionChanged method is protected. What is the proper way to register interest?

ObservableDictionary aDict = new ObservableDictionary();
aDict.CollectionChanged += OnCollectionChanged;

Thank for the great work!

Chip</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to register to get the change events directly. The following code is what I am attempting, but the collectionChanged method is protected. What is the proper way to register interest?</p>
<p>ObservableDictionary aDict = new ObservableDictionary();<br />
aDict.CollectionChanged += OnCollectionChanged;</p>
<p>Thank for the great work!</p>
<p>Chip</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-95</link>
		<dc:creator>Ken</dc:creator>
		<pubDate>Thu, 02 Jul 2009 00:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-95</guid>
		<description>This is great. Well done!</description>
		<content:encoded><![CDATA[<p>This is great. Well done!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dr. WPF</title>
		<link>http://drwpf.com/blog/2007/09/16/can-i-bind-my-itemscontrol-to-a-dictionary/comment-page-1/#comment-94</link>
		<dc:creator>Dr. WPF</dc:creator>
		<pubDate>Thu, 08 Jan 2009 05:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://drwpf.com/blog/?p=8#comment-94</guid>
		<description>Thanks for the suggested improvements, Yurik and Jim.  &lt;br&gt;&lt;br&gt;There are actually lots of optimizations that could be made to this class, but I&#039;ve not had the bandwidth to properly test such changes, and I continue to procrastinate there. :(  I took a lot of shortcuts (like editing an item by simply removing the old and adding the new) when I first put the class together.&lt;br&gt;&lt;br&gt;I&#039;m happy to post any suggested improvements that have been tested.  You can reach me at ask[at]drwpf.com.  My response time depends entirely on my workload.  :)</description>
		<content:encoded><![CDATA[<p>Thanks for the suggested improvements, Yurik and Jim.  </p>
<p>There are actually lots of optimizations that could be made to this class, but I&#8217;ve not had the bandwidth to properly test such changes, and I continue to procrastinate there. <img src='http://drwpf.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   I took a lot of shortcuts (like editing an item by simply removing the old and adding the new) when I first put the class together.</p>
<p>I&#8217;m happy to post any suggested improvements that have been tested.  You can reach me at ask[at]drwpf.com.  My response time depends entirely on my workload.  <img src='http://drwpf.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
