public async void SaveMemo() { _memo.Title = TitleEntry; _memo.Content = ContentEditor; var viewModel = new MainViewModel(_pageService, _sqlite); //{ // SelectedMemo = null //}; if (_memo.Id == 0) { MemoAdded?.Invoke(this, _memo); await _sqlite.AddMemo(_memo); } else { await _sqlite.UpdateMemo(_memo); MemoUpdated?.Invoke(this, _memo); } await _pageService.PopAsync(); }
private async void OnSave(object sender, EventArgs e) { var memo = BindingContext as Memo; if (String.IsNullOrWhiteSpace(memo.Title)) { await DisplayAlert("Error", "Please enter the title.", "OK"); return; } if (memo.Id == 0) { MemoAdded?.Invoke(this, memo); } else { MemoUpdated?.Invoke(this, memo); } await Navigation.PopAsync(); }