<?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: Property change notifications for multithreaded Silverlight applications</title>
	<atom:link href="http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/</link>
	<description>Silverlight, rich client apps and web development</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:09:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Philip Colmer</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-7997</link>
		<dc:creator>Philip Colmer</dc:creator>
		<pubDate>Tue, 27 Dec 2011 11:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-7997</guid>
		<description>Solved it ... I pass the synchronization context for the UI thread to the background thread which then posts to code that calls the registered event handler. It looks like that is the cleanest way to do it ... not sure if it really is, but it works ;-)</description>
		<content:encoded><![CDATA[<p>Solved it &#8230; I pass the synchronization context for the UI thread to the background thread which then posts to code that calls the registered event handler. It looks like that is the cleanest way to do it &#8230; not sure if it really is, but it works <img src='http://www.jeff.wilcox.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Colmer</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-7996</link>
		<dc:creator>Philip Colmer</dc:creator>
		<pubDate>Tue, 27 Dec 2011 10:50:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-7996</guid>
		<description>Hi Jeff

I&#039;ve used this to great effect to solve the issue of a background thread needing to update the UI but I&#039;m now stuck where that same thread needs to call a registered event handler. The event handler is registered by a class created in the UI thread but it isn&#039;t a data binding so your code doesn&#039;t seem to help me solve this problem. Any suggestions on how to deal with this, e.g. an article I read, code to try, etc?

Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Jeff</p>
<p>I&#8217;ve used this to great effect to solve the issue of a background thread needing to update the UI but I&#8217;m now stuck where that same thread needs to call a registered event handler. The event handler is registered by a class created in the UI thread but it isn&#8217;t a data binding so your code doesn&#8217;t seem to help me solve this problem. Any suggestions on how to deal with this, e.g. an article I read, code to try, etc?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-7913</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 20 Oct 2011 06:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-7913</guid>
		<description>Either is fine. They are all the same instance.</description>
		<content:encoded><![CDATA[<p>Either is fine. They are all the same instance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Hammar</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-7911</link>
		<dc:creator>Andreas Hammar</dc:creator>
		<pubDate>Thu, 20 Oct 2011 06:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-7911</guid>
		<description>Good stuff.

But, as Anthonywjones said, why not in the SmartDispatcher get the _instance from:

Deployment.Current.Dispatcher

instead of the RootVisual?

Thanks!</description>
		<content:encoded><![CDATA[<p>Good stuff.</p>
<p>But, as Anthonywjones said, why not in the SmartDispatcher get the _instance from:</p>
<p>Deployment.Current.Dispatcher</p>
<p>instead of the RootVisual?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Baker</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2484</link>
		<dc:creator>Bob Baker</dc:creator>
		<pubDate>Sat, 17 Apr 2010 02:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2484</guid>
		<description>Hmm. Might be Resharper 5.0. I suspended it, and all error indications went away. Resharper seems to think there is no non-generic Action delegate.</description>
		<content:encoded><![CDATA[<p>Hmm. Might be Resharper 5.0. I suspended it, and all error indications went away. Resharper seems to think there is no non-generic Action delegate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob Baker</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2483</link>
		<dc:creator>Bob Baker</dc:creator>
		<pubDate>Sat, 17 Apr 2010 01:56:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2483</guid>
		<description>Um, so this appears to be broken in VS2010 RTM. Anything using it built fine in the RC. There is no longer a type System.Action that does not require a generic  (or more than one for that matter). Is is just broken on my machine (BOMM lol)?</description>
		<content:encoded><![CDATA[<p>Um, so this appears to be broken in VS2010 RTM. Anything using it built fine in the RC. There is no longer a type System.Action that does not require a generic  (or more than one for that matter). Is is just broken on my machine (BOMM lol)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Links (4/12/2010) &#171; Steve Pietrek-Everything SharePoint/Silverlight</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2447</link>
		<dc:creator>Links (4/12/2010) &#171; Steve Pietrek-Everything SharePoint/Silverlight</dc:creator>
		<pubDate>Tue, 13 Apr 2010 02:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2447</guid>
		<description>[...] Property change notifications for multithreaded Silverlight applications [...]</description>
		<content:encoded><![CDATA[<p>[...] Property change notifications for multithreaded Silverlight applications [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Wilcox</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2396</link>
		<dc:creator>Jeff Wilcox</dc:creator>
		<pubDate>Sun, 04 Apr 2010 16:56:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2396</guid>
		<description>Sure thing, glad to help.

On the Silverlight 4 thing, you will find that even my solution has some issues that would not work if this was baked into the platform, so its best addressed as a one-off thing for now in my opinion.</description>
		<content:encoded><![CDATA[<p>Sure thing, glad to help.</p>
<p>On the Silverlight 4 thing, you will find that even my solution has some issues that would not work if this was baked into the platform, so its best addressed as a one-off thing for now in my opinion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MicroInnovators</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2395</link>
		<dc:creator>MicroInnovators</dc:creator>
		<pubDate>Sun, 04 Apr 2010 16:00:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2395</guid>
		<description>Thanks for providing the code. Im surprised this wasnt addressed in SL 4.</description>
		<content:encoded><![CDATA[<p>Thanks for providing the code. Im surprised this wasnt addressed in SL 4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthonywjones</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2392</link>
		<dc:creator>Anthonywjones</dc:creator>
		<pubDate>Sat, 03 Apr 2010 20:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2392</guid>
		<description>It is a sticky problem to solve.

It does smell all wrong to load the solution of this problem on to the data classes.  The problem is a result of the way the UI works so it seems only fair that code in the UI should solve the problem.  Instead what we have here is the data classes jump through hoops (including the introduction of base class) just in case it might make the UI code barf. 
 
That said it is a pragmatic solution based on reasonable assumptions. 

I&#039;m curious about a couple of things though:-

Why not simply acquire a value for _instance from Deployment.Current during  a static constructor on  SmartDispatcher?  It seems to me that would simplify some of the code.

Also are we sure that when running in a designer CheckAccess won&#039;t be called?  It may throw if it is since _instance may remain null.</description>
		<content:encoded><![CDATA[<p>It is a sticky problem to solve.</p>
<p>It does smell all wrong to load the solution of this problem on to the data classes.  The problem is a result of the way the UI works so it seems only fair that code in the UI should solve the problem.  Instead what we have here is the data classes jump through hoops (including the introduction of base class) just in case it might make the UI code barf. </p>
<p>That said it is a pragmatic solution based on reasonable assumptions. </p>
<p>I&#8217;m curious about a couple of things though:-</p>
<p>Why not simply acquire a value for _instance from Deployment.Current during  a static constructor on  SmartDispatcher?  It seems to me that would simplify some of the code.</p>
<p>Also are we sure that when running in a designer CheckAccess won&#8217;t be called?  It may throw if it is since _instance may remain null.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dew Drop &#8211; April 3, 2010 &#124; Alvin Ashcraft&#39;s Morning Dew</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2390</link>
		<dc:creator>Dew Drop &#8211; April 3, 2010 &#124; Alvin Ashcraft&#39;s Morning Dew</dc:creator>
		<pubDate>Sat, 03 Apr 2010 15:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2390</guid>
		<description>[...] Property change notifications for multithreaded Silverlight applications (Jeff Wilcox) [...]</description>
		<content:encoded><![CDATA[<p>[...] Property change notifications for multithreaded Silverlight applications (Jeff Wilcox) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Haathen</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2387</link>
		<dc:creator>Haathen</dc:creator>
		<pubDate>Sat, 03 Apr 2010 04:41:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2387</guid>
		<description>@Morten:
This article is about Silverlight and -unfortunately- here they can only be created on the UI thread.

See:
http://forums.silverlight.net/forums/p/164744/371088.aspx#371088

This has not been changed in RC.</description>
		<content:encoded><![CDATA[<p>@Morten:<br />
This article is about Silverlight and -unfortunately- here they can only be created on the UI thread.</p>
<p>See:<br />
<a href="http://forums.silverlight.net/forums/p/164744/371088.aspx#371088" rel="nofollow">http://forums.silverlight.net/forums/p/164744/371088.aspx#371088</a></p>
<p>This has not been changed in RC.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2386</link>
		<dc:creator>Joe</dc:creator>
		<pubDate>Sat, 03 Apr 2010 02:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2386</guid>
		<description>Jeff,

Is there any hard and fast rule about not allowing the property name to be null when calling NotifyPropertyChanged()?

It has been my experience that you can use &#039;null&#039; as a parameter and it has the effect of providing notification for all the properties, not just one specifically.

Regards,

Joe</description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>Is there any hard and fast rule about not allowing the property name to be null when calling NotifyPropertyChanged()?</p>
<p>It has been my experience that you can use &#8216;null&#8217; as a parameter and it has the effect of providing notification for all the properties, not just one specifically.</p>
<p>Regards,</p>
<p>Joe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Wilcox</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2383</link>
		<dc:creator>Jeff Wilcox</dc:creator>
		<pubDate>Fri, 02 Apr 2010 20:46:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2383</guid>
		<description>@Morten,
Yeah, so I am making the assumption that the listening is only on the main UI thread. With the exception of MVVM zealots, who will already have solutions in place for this sort of thing, property change notifications are a majority (&quot;80% is the number I randomly pick&quot;) of what&#039;s going to be done with those values for most people who aren&#039;t taking this into account today.</description>
		<content:encoded><![CDATA[<p>@Morten,<br />
Yeah, so I am making the assumption that the listening is only on the main UI thread. With the exception of MVVM zealots, who will already have solutions in place for this sort of thing, property change notifications are a majority (&#8220;80% is the number I randomly pick&#8221;) of what&#8217;s going to be done with those values for most people who aren&#8217;t taking this into account today.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Morten</title>
		<link>http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/comment-page-1/#comment-2378</link>
		<dc:creator>Morten</dc:creator>
		<pubDate>Fri, 02 Apr 2010 19:08:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/04/propertychangedbase-crossthread/#comment-2378</guid>
		<description>Aren&#039;t you assuming that other objects are listening to the propertychanged event on the UI Thread only? What if the background thread was spun up from another background thread. I would want my events to fire on the other backgronud thread, and not suddenly end up over in a UI thread.
I try only a use dispatcher when I know I&#039;m dealing with UI Controls (ie I think only UI Controls should be using the dispatcher). If I&#039;m just dealing with DependencyObjects, that&#039;s a whole different story, since there&#039;s no guarantee that these have been created on the UI Thread.</description>
		<content:encoded><![CDATA[<p>Aren&#8217;t you assuming that other objects are listening to the propertychanged event on the UI Thread only? What if the background thread was spun up from another background thread. I would want my events to fire on the other backgronud thread, and not suddenly end up over in a UI thread.<br />
I try only a use dispatcher when I know I&#8217;m dealing with UI Controls (ie I think only UI Controls should be using the dispatcher). If I&#8217;m just dealing with DependencyObjects, that&#8217;s a whole different story, since there&#8217;s no guarantee that these have been created on the UI Thread.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

