Saving a background image to local storage
In this recipe we will learn how to save image files to a local storage folder. We will make use of the IsolatedStorageFile
class.
Getting ready
For this recipe let's copy the simple MyTasks
app solution folder we built in the previous recipe and rename the folder to Ch2_Recipe4_MyTasks
. After you open the project, just press F5 and run it to make sure you don't get any errors.
How to do it...
Let's add a button control in the settings page to launch the built-in Photo Chooser utility. Once the desired photo is selected we will save the image to local storage.
Open the settings
.xaml
file and add a text block control and button control inside theContentPanel
grid:<TextBlock Height="55" HorizontalAlignment="Left" Margin="12,199,0,0" Name="textBlock1" Text="Bacground Image" TextWrapping="Wrap" VerticalAlignment="Top" Width="115" /> <Button Content="Browse" Height="77" Margin="119,0,70,331" Name="btnBrowse" VerticalAlignment="Bottom" Click="btnBrowse_Click...