Archive for July, 2010

While working on a project at my new job I ran across a problem where I needed to update a WPF UI (databound collection) from an async call. There are tons of examples on the internet of how to do this, but few of them seem tailored for the MVVM model where your ViewModel doesn’t have knowledge of the view (and thus doesn’t have access to the view’s Dispatcher). For scalar types this isn’t a problem as they are marshaled to the UI thread in WPF, but for collections bound to controls, this becomes asynchronous updating is an issue.

Fortunately, Jeremy Likness came up with an elegant solution. Instead of regurgitating what he did, I’ll just point you to his blog post. While is post is about Silverlight, this is also applicable to WPF.

I thought his solution was simple & elegant (and best of all, it works!)

Dispatching In Silverlight