Windows Phone 7 Tutorial Part 3 Available

Published Mon, Jan 10 2011 14:37

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

Comments

# Richard Stacy said on Wednesday, January 19, 2011 9:37 AM

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.

# Burrows said on Wednesday, January 19, 2011 10:11 AM

Hi Richard,

You need to install three things:

Windows Phone Developer Tools RTW:

www.microsoft.com/.../details.aspx

Visual Basic for Windows Phone Developer Tools - RTW:

www.microsoft.com/.../details.aspx

Silverlight for Windows Phone Toolkit:

silverlight.codeplex.com

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

Open Data Protocol - Client Libraries:

odata.codeplex.com/.../54698

bill

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: