<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: .NET Basics &#8211; Do Work in Background Thread to Keep GUI Responsive</title>
	<atom:link href="http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/</link>
	<description>Learning new software development technologies out loud</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:08:38 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Albert</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-422</link>
		<dc:creator>Albert</dc:creator>
		<pubDate>Wed, 30 Sep 2009 17:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-422</guid>
		<description>p.s.s. also i&#039;m doing something funkier with the _ProgressChanged(object sender, ProgressChangedEventArgs e) function:

the ProgressChangedEventArgs e object has a property called e.UserState which is an object. 

I&#039;m using this backgroundworker in an app where I am sending an Image to a ListView for display as it finds the Images on disk. So I am actually passing the Image object to the ProgressChanged handler by passing the Image as a (object) through the e.UserState ! 

then my progresschanged handler function casts it back to (Image) and adds it to the ListView.LargeImageList

and it works! and it works pretty fast too! so just a tip since e.UserState is an (object) you could pass almost anything through it and cast it back at the UI thread&#039;s handler function.</description>
		<content:encoded><![CDATA[<p>p.s.s. also i&#8217;m doing something funkier with the _ProgressChanged(object sender, ProgressChangedEventArgs e) function:</p>
<p>the ProgressChangedEventArgs e object has a property called e.UserState which is an object. </p>
<p>I&#8217;m using this backgroundworker in an app where I am sending an Image to a ListView for display as it finds the Images on disk. So I am actually passing the Image object to the ProgressChanged handler by passing the Image as a (object) through the e.UserState ! </p>
<p>then my progresschanged handler function casts it back to (Image) and adds it to the ListView.LargeImageList</p>
<p>and it works! and it works pretty fast too! so just a tip since e.UserState is an (object) you could pass almost anything through it and cast it back at the UI thread&#8217;s handler function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-421</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 30 Sep 2009 15:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-421</guid>
		<description>Thanks Sean, I had always been aware of doing things in a background thread being a good practice with windows forms but was daunted by the idea of turning an otherwise simple app multi-threaded.  Thanks to your examples I don&#039;t have to be further disgusted by my overuse of application.doevents(). Much appreciated!</description>
		<content:encoded><![CDATA[<p>Thanks Sean, I had always been aware of doing things in a background thread being a good practice with windows forms but was daunted by the idea of turning an otherwise simple app multi-threaded.  Thanks to your examples I don&#8217;t have to be further disgusted by my overuse of application.doevents(). Much appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-420</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Thu, 24 Sep 2009 22:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-420</guid>
		<description>Thanks Albert.  Good question (why).  My quick guess is that the underlying Win32 controls are not thread-safe, so we have to appoint a single thread to do all of the updates.  But I&#039;d like to dig a little bit deeper to also understand the lower-level aspects of what&#039;s going on.  Stay tuned--sounds like a good topics for a future post.</description>
		<content:encoded><![CDATA[<p>Thanks Albert.  Good question (why).  My quick guess is that the underlying Win32 controls are not thread-safe, so we have to appoint a single thread to do all of the updates.  But I&#8217;d like to dig a little bit deeper to also understand the lower-level aspects of what&#8217;s going on.  Stay tuned&#8211;sounds like a good topics for a future post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: albert</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-419</link>
		<dc:creator>albert</dc:creator>
		<pubDate>Thu, 24 Sep 2009 21:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-419</guid>
		<description>This is the best UI multithreading tutorial on the web I have found yet. Everyone else&#039;s tutorial is horrible. This one here is the most concise, most descriptive, most easily understandable. I feel like all the other tutorials are just copying off eachother and no one knows how to explain it well. Thanks for writing one that finally explains it well.

P.S. No one has explained *why* a form control can never be updated from outside the UI thread. Why can that never happen? Is it just a security measure .net has to prevent controls from being manipulated by viruses or other programs?</description>
		<content:encoded><![CDATA[<p>This is the best UI multithreading tutorial on the web I have found yet. Everyone else&#8217;s tutorial is horrible. This one here is the most concise, most descriptive, most easily understandable. I feel like all the other tutorials are just copying off eachother and no one knows how to explain it well. Thanks for writing one that finally explains it well.</p>
<p>P.S. No one has explained *why* a form control can never be updated from outside the UI thread. Why can that never happen? Is it just a security measure .net has to prevent controls from being manipulated by viruses or other programs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dirk</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-391</link>
		<dc:creator>Dirk</dc:creator>
		<pubDate>Fri, 24 Jul 2009 12:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-391</guid>
		<description>Thanks mate!</description>
		<content:encoded><![CDATA[<p>Thanks mate!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Batul</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-375</link>
		<dc:creator>Batul</dc:creator>
		<pubDate>Thu, 25 Jun 2009 15:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-375</guid>
		<description>Thanks a lot. This post is really useful. I started as a novice in threading... but got my application working. Many many thanks.</description>
		<content:encoded><![CDATA[<p>Thanks a lot. This post is really useful. I started as a novice in threading&#8230; but got my application working. Many many thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
