private async Task InsertNatanItem(NatanTest natanItem) { // This code inserts a new TodoItem into the database. After the operation completes // and the mobile app backend has assigned an id, the item is added to the CollectionView. await natanTable.InsertAsync(natanItem); natanItems.Add(natanItem); #if OFFLINE_SYNC_ENABLED await App.MobileService.SyncContext.PushAsync(); // offline sync #endif }
private async void ButtonSave_Click(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Text = TextInput.Text }; TextInput.Text = ""; await InsertTodoItem(todoItem); var natanItem = new NatanTest { GameName = "NatiGame" }; await InsertNatanItem(natanItem); }