Windows Phone 7 Tutorial Part 3 Available

I just published the third tutorial in my series on Windows Phone 7. This part completes the Golf Handicap application by adding the ability to manage scores from rounds of golf.

SNAGHTML11fb485

This was a very interesting exercise and provides a example of using OData and web services with Windows Phone 7.

My initial design of the Scores view model was based on the ability in OData to use the “expand” operation so that an entity AND its associated entity could be downloaded from the web service. I built a DataServiceCollection of Scores and each score included the single course it was associated with. As you can see in the image above, a score only makes sense in the context of the course were the round was played.

This initial design worked great until I started to test out “Tombstoning” – the ability of the application to be placed into the background while another application is running and then restored when the application is brought back to the foreground. I simply could not make the code work; trying to restore the data service state threw an exception no matter what I tried.

I spent several days trying a variety of things to correct the problem. Finally, in frustration, I posted a query on the Data Services forum to see if I could get some help. Shortly after posting the question, a Microsoft person informed me that data service state’s “Restore” method could not handle an object graph with more than one entity. In other words, I could not do what I was trying to do given the current capabilities of the OData Data Services. Hopefully that shortcoming will be overcome in later releases.

In the mean time, you can see how I revised my design (and the implications of the revised design) in this new tutorial.

Enjoy … bill



10 Responses to “Windows Phone 7 Tutorial Part 3 Available”

  1.   Richard Stacy Says:

    Downloaded the source code for this and when I attempt to open it I get a message saying Visual Studio has stopped working. I have downloaded the Windows Phone Developer Tools and wondering if there was something I am missing and need to install.

  2.   Burrows Says:

    Hi Richard,

    You need to install three things:

    Windows Phone Developer Tools RTW:
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce

    Visual Basic for Windows Phone Developer Tools – RTW:
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4e97ea70-e479-4c05-814f-639d71690e5d

    Silverlight for Windows Phone Toolkit:
    http://silverlight.codeplex.com/

    If you are going to do any development, you also need:

    Open Data Protocol – Client Libraries:
    http://odata.codeplex.com/releases/view/54698

    bill

Leave a Reply