public void DeleteEntry(DiaryEntry entryToDelete) { if (DiaryEntries != null) { DiaryEntries.Remove(entryToDelete); } }
private async void RemoveEntry(ViewModel_DiaryEntry entry) { //Removes an entry bool answer = await App.Current.MainPage.DisplayAlert("Removing a Diary Entry", "Are you sure you want to delete this Diary Entry?", "Yes", "No"); if (answer == true) { Console.WriteLine("Removing Entry "); DiaryEntries.Remove(entry); List <ViewModel_DiaryPage> entries = new List <ViewModel_DiaryPage>(DiaryEntries); UserDiaryFileController.Save(entries); } }