async private void OnAdd(object sender, EventArgs e) { string date = DateTime.Today.ToString("dd.MM.yyyy"); string sortdate = DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss"); var page = new DetailsNote(new Notes { Label = "Text note ", Date = date, SortDate = sortdate }); page.NoteAdded += (source, note) => { _note.Add(note); }; await Navigation.PushAsync(page); }
async void Selected(object sender, SelectedItemChangedEventArgs e) { if (listView.SelectedItem == null) { return; } var selectedNote = e.SelectedItem as Notes; listView.SelectedItem = null; var page = new DetailsNote(selectedNote); page.NoteUpdated += (source, note) => { selectedNote.Id = note.Id; selectedNote.Label = note.Label; selectedNote.TextNote = note.TextNote; selectedNote.Date = note.Date; }; await Navigation.PushAsync(page); }