public async void OnAdd(object sender, EventArgs e)
        {
            var todo = new MyNote {
                Title = newItemName.Text
            };

            await AddItem(todo);

            newItemName.Text = string.Empty;
            newItemName.Unfocus();
        }
Beispiel #2
0
 public async Task SaveTaskAsync(MyNote item)
 {
     //if (item.Id == null)
     //{
     //    await todoTable.InsertAsync(item);
     //}
     if (item.Id == null)
     {
         await todoTable.InsertAsync(item);
     }
     else
     {
         await todoTable.UpdateAsync(item);
     }
 }
        private async void SaveButton_OnClicked(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(titleText.Text) && !string.IsNullOrWhiteSpace(descriptionText.Text))
            {
                var newNote = new MyNote()
                {
                    TimeStamp   = DateTime.Now,
                    Title       = titleText.Text,
                    Description = descriptionText.Text,
                };

                titleText.Text       = string.Empty;
                descriptionText.Text = string.Empty;

                await _myNotesTable.InsertAsync(newNote);

                await RefreshItems();
            }
        }
 async Task CompleteItem(MyNote item)
 {
     //item.Done = true;
     //await manager.SaveTaskAsync(item);
     //todoList.ItemsSource = await manager.GetTodoItemsAsync();
 }
        // Data methods
        async Task AddItem(MyNote item)
        {
            await manager.SaveTaskAsync(item);

            todoList.ItemsSource = await manager.GetTodoItemsAsync();
        }