<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Designer Silverlight &#187; WPF Performance</title>
	<atom:link href="http://www.designersilverlight.com/category/wpf-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designersilverlight.com</link>
	<description>Matthias Shapiro's Silverlight &#38; WPF Blog - Because Developers Get All The Good Blogs</description>
	<lastBuildDate>Thu, 26 Jan 2012 06:45:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>ListView (and ListBox) Performance Issues</title>
		<link>http://www.designersilverlight.com/2008/02/12/listview-and-listbox-performance-issues/</link>
		<comments>http://www.designersilverlight.com/2008/02/12/listview-and-listbox-performance-issues/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 23:46:02 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[listview]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Performance]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[Mark Shurmer]]></category>
		<category><![CDATA[VirtualizingStackPanel]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/2008/02/12/listview-and-listbox-performance-issues/</guid>
		<description><![CDATA[I was working on one of my projects today and I noticed that one of our popups displaying search results in a ListBox was having really serious performance problems.  After determining that the problem was, in fact, on the WPF side of things, I was somewhat baffled. I wasn&#8217;t doing anything that I could think of that should be [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on one of my projects today and I noticed that one of our popups displaying search results in a ListBox was having really serious performance problems.  After determining that the problem was, in fact, on the WPF side of things, I was somewhat baffled. I wasn&#8217;t doing anything that I could think of that should be pushing the limit of what WPF could do.</p>
<p> Finally, I went looking online for an answer and discovered a list of possible <a href="http://itknowledgeexchange.techtarget.com/wpf/listview-is-it-really-too-slow/">performance killers for the ListView (and ListBox) on Mark Shurmer&#8217;s blog</a>. Chief among his no-no&#8217;s:</p>
<blockquote><p>Embedding the ListView inside a StackPanel</p></blockquote>
<p>Which is exactly what I was doing.</p>
<p>Why is this a problem? To answer that question, let&#8217;s take a look at the ItemsPanel at runtime using <a href="http://www.designersilverlight.com/2007/12/27/designers-guide-to-debugging-wpf-applications-with-snoop/">Snoop</a>. When I place my ListBox into a Grid, here is what my ItemsPanel looks like:</p>
<p><span id="more-162"></span></p>
<p><img src="http://www.designersilverlight.com/wp-content/uploads/2008/02/gooditemspanel.png" alt="goodItemsPanel" /></p>
<p>If I change back to what I originally had (my ListBox in a StackPanel), here is what my ItemsPanel looks like:</p>
<p><img src="http://www.designersilverlight.com/wp-content/uploads/2008/02/baditemspanel.png" alt="BadItemsPanel1" /><img src="http://www.designersilverlight.com/wp-content/uploads/2008/02/baditemspanel2.png" alt="badItemsPanel2" />             <img src="http://www.designersilverlight.com/wp-content/uploads/2008/02/baditemspanel3.png" alt="BadItemsPanel3" /></p>
<p>That&#8217;s actually not even the end of it. That&#8217;s about half.</p>
<p>As far as I can tell, all of Mark&#8217;s suggestions have to do with making sure that the VirtualizingStackPanel can do what it needs to do in order to keep your program running at a reasonable rate. Good stuff.</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.designersilverlight.com/2008/02/12/listview-and-listbox-performance-issues/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=ListView+%28and+ListBox%29+Performance+Issues+http%3A%2F%2Fdesignersilverlight.com%2F%3Fp%3D162" title="Post to Twitter"><img class="nothumb" src="http://www.designersilverlight.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=ListView+%28and+ListBox%29+Performance+Issues+http%3A%2F%2Fdesignersilverlight.com%2F%3Fp%3D162" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2008/02/12/listview-and-listbox-performance-issues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

