private void DeleteNote(object sender, EventArgs e) { if (Note.Id != 0) { DataAccessObject.DeleteNote(Note.Id); NavigateToMainPage(); } else { DisplayAlert("Error", "Cannot delete non existent note", "OK"); } }