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

Writing Windows Phone 7 Unleashed

28 Jul 2010

For the last couple of months I’ve had my head down writing a WP7 book. Entitled Windows Phone 7 Unleashed, it will be published though Sams Publishing. I’m pouring lots of tips and techniques into this book, along with the requisite WP7 development info. The book will lead you through end to end production of WP7 apps, from developing Silverlight and XNA apps, through to certification and publishing on the Windows Phone Marketplace. Figure 1....

Read more