public void Execute(object parameter) { // Try to delete the file, both from the file system, and the active memory. try { NotesRepo.DeleteNoteFile(notesViewModel.SelectedNote.Title + ".txt"); notesViewModel.AllNotes.Remove(notesViewModel.SelectedNote); notesViewModel.FilterNotes(); notesViewModel.SelectedNote = null; } catch (Exception) { Debug.Fail("Error deleting note file from file system."); } }
// ASync function to load all notes from the file system. public async void LoadNotes() { this.AllNotes = await NotesRepo.LoadNotesFromFile(); FilterNotes(); }