private void Email_Icon_Click(object sender, EventArgs e) { try { WriteableBitmap bi = App.ReadImageFromIsolatedStorage("gRouteTemp.jpg"); if (bi != null) { this.TestImage.Source = bi; } Tasks.ComposeEmail("*****@*****.**", "[WP]", GPointConverter.FromGRouteToIsolatedStorageFormat(App.gRouteTrackViewModel.CurrentRoute), ""); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static void SaveToIsolatedStorage() { using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { if (!gRouteTrackViewModel.CurrentRoute.IsFinished) { using (IsolatedStorageFileStream fileStream = isf.CreateFile("CurrentRoute.xml")) { StreamWriter writter = new StreamWriter(fileStream); writter.Write(GPointConverter.FromGRouteToIsolatedStorageFormat(gRouteTrackViewModel.CurrentRoute)); writter.Close(); } } using (IsolatedStorageFileStream fileStream = isf.CreateFile("Routes.xml")) { StreamWriter writter = new StreamWriter(fileStream); writter.Write(GPointConverter.FromGRoutesToIsolatedStorageFormat(gRouteTrackViewModel.RoutesOnPhone.ToList <GRoute>())); writter.Close(); } } }