private async void OnDeleteEntry(object sender, EventArgs e) { if (await DisplayAlert("Delete Entry", $"Are you sure you want to delete the entry {Title}?", "Yes", "No")) { await App.Entries.DeleteAsync(entry); entry = null; await Navigation.PopAsync(); } }
private async void OnAddNewEntry(object sender, EventArgs e) { string text = newEntry.Text; if (!string.IsNullOrWhiteSpace(text)) { var item = new NoteTake { Title = text }; await App.Entries.AddAsync(item); await Navigation.PushAsync(new NoteEntryEditPage(item)); newEntry.Text = string.Empty; } }
public NoteEntryEditPage(NoteTake entry) { InitializeComponent(); BindingContext = this.entry = entry; }