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 ButtonSave_Click(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Text = TextInput.Text , NewContent = "New Info" }; #region 02_04 Push Notification todoItem.Channel = App.CurrentChannel.Uri; #endregion 02_04 Push Notification InsertTodoItem(todoItem); }
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); #region 03_02 Existing DB //var downloadItemTable = App.MobileService.GetTable<DownloadItem>(); //var downloadItems = await downloadItemTable.ToListAsync(); //DownloadItem newDownloadItem = new DownloadItem() //{ // Caption = "Slides", // Description = "Mobile Service", // Url = "http://someurl.de" //}; //await downloadItemTable.InsertAsync(newDownloadItem); #endregion 03_02 Existing DB }