O'Reilly logo

Windows Phone 7.5 Data Cookbook by Ramesh Thalli

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

Opening and creating a file

In this recipe, we will learn how to open a file from local file storage and how to save the user settings to local file storage.

Getting ready

  1. Open Visual Studio for Phone 7 and create a Windows Phone Application. Name the application Ch2_Recipe2 and click on OK.
  2. After you open the project, just press F5 and run it to make sure you don't get any error.

How to do it...

Let's build a simple page with a textbox to enter text to save and a text block to display the saved text in the local file storage.

  1. Open the MainPage.xaml file and change the application title and page title to MY RECIPES and iFileStorage respectively:
    <!--TitlePanel contains the name of the application and page title--> <StackPanel x:Name="TitlePanel" Grid.Row="0" ...

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