O'Reilly logo

Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® by Robert Fonseca-Ensor, Karli Watson, Nick Lecrenski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 5 EXERCISE SOLUTIONS

Exercise 1 Solution

The answer is a and c. When an application requires you to write custom data files to Isolated Storage, you should make use of the IsolatedStorageFile object. If your application only needs to quickly save objects in a name/value pair format, you can use the IsolatedStorageSettings object instead.

Exercise 2 Solution

False. When your application is first being run, it can run custom code in the Application_Launching event handler. When your application is in the running state, no separate event is fired. After the Launched event has been processed, your application is considered to be running, and you can add custom code to the Loaded event handlers of various pages in the application.

Exercise 3 Solution

Your application is free to use any available memory on the device. You can check to see how much memory is available by checking the AvailableFreeSpace property of the IsolatedStorageSettings.ApplicationSettings object. Of course, you shouldn't use all the available space on the device because there will most likely be additional applications that also have storage requirements. Using all the available free space is a good way to ensure that users uninstall your application.

Exercise 4 Solution

When a user navigates to a certain page in your application, you can override the OnNavigatedTo method to run custom code. Alternatively, when a user navigates away from that page, you can also run custom code by overriding the OnNavigatedFrom ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required