/// <summary> /// Delete all app data, including users (execept 'Everyone') /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void DeleteAllButton_Tapped(object sender, TappedRoutedEventArgs e) { var dialog = new DeleteConfirmationDialog(); await dialog.ShowAsync(); if (dialog.DeleteData == false) { return; } // Delete FamilyNotesData and ink.isf IsolatedStorageFile appLocalData = IsolatedStorageFile.GetUserStoreForApplication(); if (appLocalData.FileExists(App.NOTES_MODEL_FILE)) { appLocalData.DeleteFile(App.NOTES_MODEL_FILE); } if (appLocalData.FileExists(App.NOTES_INK_FILE)) { appLocalData.DeleteFile(App.NOTES_INK_FILE); } foreach (string name in FamilyModel.Family.Select(person => person.FriendlyName).ToList()) { bool success = await FamilyModel.DeletePersonAsync(name); Debug.Assert(success == true, "Unable to delete person"); } }
private async void MenuFlyoutOptionDeletePerson(object sender, RoutedEventArgs e) { var dialog = new DeleteConfirmationDialog(); await dialog.ShowAsync(); if (dialog.DeleteData == false) { return; } Person selectedPerson = (Person)(sender as MenuFlyoutItem).Tag; await this.FamilyModel.DeletePersonAsync(selectedPerson.FriendlyName); }