<?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: TreeView and ObservableCollection weird bug</title>
	<atom:link href="http://khason.net/blog/treeview-and-observablecollection-weird-bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/</link>
	<description>Take care of the sense, and the sounds will take care of themselves.</description>
	<lastBuildDate>Fri, 18 May 2012 08:56:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: How to Get Six Pack Fast</title>
		<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/comment-page-1/#comment-2935</link>
		<dc:creator>How to Get Six Pack Fast</dc:creator>
		<pubDate>Wed, 15 Apr 2009 17:58:49 +0000</pubDate>
		<guid isPermaLink="false">http://khason.net/blog/treeview-and-observablecollection-weird-bug/#comment-2935</guid>
		<description>This is quite a up-to-date information. I&#039;ll share it on Digg.</description>
		<content:encoded><![CDATA[<p>This is quite a up-to-date information. I&#8217;ll share it on Digg.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony</title>
		<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/comment-page-1/#comment-479</link>
		<dc:creator>Anthony</dc:creator>
		<pubDate>Thu, 01 Jan 2009 08:10:40 +0000</pubDate>
		<guid isPermaLink="false">http://khason.net/blog/treeview-and-observablecollection-weird-bug/#comment-479</guid>
		<description>&lt;p&gt;This workaround provides 4 collectionchanged events. Don&#039;t know if this will help anybody.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This workaround provides 4 collectionchanged events. Don&#8217;t know if this will help anybody.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tamir Khason</title>
		<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/comment-page-1/#comment-478</link>
		<dc:creator>Tamir Khason</dc:creator>
		<pubDate>Thu, 01 Jan 2009 08:10:38 +0000</pubDate>
		<guid isPermaLink="false">http://khason.net/blog/treeview-and-observablecollection-weird-bug/#comment-478</guid>
		<description>&lt;p&gt;Thank you, Anthony. I&#039;ve updated the article&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you, Anthony. I&#8217;ve updated the article</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vibhor</title>
		<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/comment-page-1/#comment-477</link>
		<dc:creator>vibhor</dc:creator>
		<pubDate>Thu, 01 Jan 2009 08:10:36 +0000</pubDate>
		<guid isPermaLink="false">http://khason.net/blog/treeview-and-observablecollection-weird-bug/#comment-477</guid>
		<description>&lt;p&gt;That code works like a charm!! Thanks a ton.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That code works like a charm!! Thanks a ton.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fedir Nepyivoda</title>
		<link>http://khason.net/blog/treeview-and-observablecollection-weird-bug/comment-page-1/#comment-476</link>
		<dc:creator>Fedir Nepyivoda</dc:creator>
		<pubDate>Thu, 01 Jan 2009 08:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://khason.net/blog/treeview-and-observablecollection-weird-bug/#comment-476</guid>
		<description>&lt;p&gt;This workaround has the side effect: the state of tree view items are lost (if they was expended, for example).&lt;/p&gt;
&lt;p&gt;The better solution is to subclass TreeView and TreeViewItem. Then override OnItemsChanged in both classes and do nothing. &lt;/p&gt;
&lt;p&gt;Like this:&lt;/p&gt;
&lt;p&gt; &#160; &#160;public class MyTreeView : TreeView&lt;/p&gt;
&lt;p&gt; &#160; &#160;{&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;{&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160; &#160; &#160; &#160; // do nothing&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;}&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;protected override DependencyObject GetContainerForItemOverride()&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;{&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160; &#160; &#160;return new MyTreeViewItem();&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;}&lt;/p&gt;
&lt;p&gt; &#160; &#160;}&lt;/p&gt;
&lt;p&gt; &#160; &#160;public class MyTreeViewItem : TreeViewItem&lt;/p&gt;
&lt;p&gt; &#160; &#160;{&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;{&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160; &#160; &#160;// do nothing&lt;/p&gt;
&lt;p&gt; &#160; &#160; &#160; &#160;}&lt;/p&gt;
&lt;p&gt; &#160; &#160;}&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This workaround has the side effect: the state of tree view items are lost (if they was expended, for example).</p>
<p>The better solution is to subclass TreeView and TreeViewItem. Then override OnItemsChanged in both classes and do nothing. </p>
<p>Like this:</p>
<p> &nbsp; &nbsp;public class MyTreeView : TreeView</p>
<p> &nbsp; &nbsp;{</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;{</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // do nothing</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;}</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;protected override DependencyObject GetContainerForItemOverride()</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;{</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return new MyTreeViewItem();</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;}</p>
<p> &nbsp; &nbsp;}</p>
<p> &nbsp; &nbsp;public class MyTreeViewItem : TreeViewItem</p>
<p> &nbsp; &nbsp;{</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;protected override void OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;{</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// do nothing</p>
<p> &nbsp; &nbsp; &nbsp; &nbsp;}</p>
<p> &nbsp; &nbsp;}</p>
]]></content:encoded>
	</item>
</channel>
</rss>

