private async void InsertTodoItem(TodoItem todoItem) { // This code inserts a new TodoItem into the database. When the operation completes // and Mobile Services has assigned an Id, the item is added to the CollectionView await todoTable.InsertAsync(todoItem); items.Add(todoItem); }
private async void UpdateCheckedTodoItem(TodoItem item) { // This code takes a freshly completed TodoItem and updates the database. When the MobileService // responds, the item is removed from the list await todoTable.UpdateAsync(item); items.Remove(item); }
private void TB_Checked(object sender, RoutedEventArgs e) { if (TB.IsChecked==true) { string str2 = "123"; var todoItem = new TodoItem { Text = str2 }; InsertTodoItem(todoItem); } }