DANIEL VAUGHAN

Debugging The Photochoosertask And Other Media Hub Related Tasks On Wp7

14 Nov 2010

Using the device debugger is a snap in Windows Phone 7. There are many benefits, and you can see your app executing in a real world environment, with most of the launchers and choosers available for testing. Some choosers, however, rely on the Windows Phone Media Hub; such as the PhotoChooserTask. Trying to debug across a call to that bad boy, with the Zune software running, will lock up your app. Fortunately there’s an easy...

Read more


Work Around For DataContractJsonSerializer ArgumentNullExceptions

25 Oct 2010

If you’ve tried using a DataContractJsonSerializer or a DataContractSerializer with Push Notification for the Windows Phone, you may have experienced an ArgumentNullException during deserialization. This can happen because the MemoryStream is buffered with null characters ‘\0’ that prevent deserialization. A solution is to create a new array and copy all bytes except for the trailing nulls, as shown in the following excerpt from the downloadable sample code in my upcoming book, Windows Phone 7 Unleashed:...

Read more


Netflix Wp7 Browser

15 Oct 2010

My wife, Katka, has published a great new article Learn how to use the Pivot and Panorama controls, page navigation, OData and more!

Read more


Conquering ReaderWriterLockSlim Mismatched Enter And Exit Calls

14 Aug 2010

The ReaderWriterLockSlim class is used to protect a resource that is read by multiple threads and written to by one thread at a time. The class exists in the desktop FCL, but is noticeably absent from the Silverlight FCL. To readily support both platforms, some time ago, I incorporated the open-source mono implementation of the ReaderWriterLockSlim class into the Silverlight version of my core library, which is downloadable from http://calcium.codeplex.com/SourceControl/list/changesets ReaderWriterLockSlim is a light-weight alternative...

Read more


Enforcing Single Instance Wpf Applications

01 Aug 2010

Introduction Today the WPF Disciples, and in particular my good friend and fellow WPF Disciple, Pete O’Hanlon, were sitting around the proverbial campfire, discussing how to enforce single instance WPF apps, for Pete’s cool Goldlight project. By single instance WPF apps, I mean limiting an executable to only one instance in execution. This can be useful in scenarios where multiple application instances may play havoc with shared state. I took some time away from writing...

Read more