예제 #1
0
        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();
            }
        }
예제 #2
0
        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;
            }
        }
예제 #3
0
 public NoteEntryEditPage(NoteTake entry)
 {
     InitializeComponent();
     BindingContext = this.entry = entry;
 }