Saving user settings
In our first recipe, we will introduce the namespace and the classes used in isolated storage and also learn how to save simple user settings to local storage and retrieve the user settings from the local storage.
Getting ready
Open the Visual Studio for Phone 7 and create a Windows Phone Application. Name the application
Ch2_Recipe1
and click on OK.After you open the project, press F5 and run it to make sure everything compiles without errors.
How to do it...
Let's build a simple page to display a textbox, where one can enter a name and store it so it automatically appears each time this app is started.
Open the
MainPage.xaml
file and change the name of the application title and page title as follows:<!--TitlePanel contains the name of the application and pagetitle--> <StackPanel x:Name="TitlePanel" Grid.Row="0" Grid.ColumnSpan="2"> <TextBlock x:Name="ApplicationTitle" Text="MY RECIPES" Style="{StaticResource PhoneTextNormalStyle}"/> <TextBlock...