コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: AranHu/TaskCloud
 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);                        
 }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: AranHu/TaskCloud
        private async void UpdateCheckedTodoItem(TodoItem item)
        {
            // This code takes a freshly completed TodoItem and updates the database.
            await todoTable.UpdateAsync(item);

// move this to Delete method - better UI
//            items.Remove(item);
        }
コード例 #3
0
        // new: hard-delete todo records
        private async void DeleteTodoItem(TodoItem item)
        {
            await todoTable.DeleteAsync(item);

            items.Remove(item);
        }
コード例 #4
0
ファイル: MainPage.xaml.cs プロジェクト: AranHu/TaskCloud
 private void ButtonSave_Click(object sender, RoutedEventArgs e)
 {
     var todoItem = new TodoItem { Text = TextInput.Text };
     InsertTodoItem(todoItem);
 }
コード例 #5
0
ファイル: MainPage.xaml.cs プロジェクト: AranHu/TaskCloud
 // new: hard-delete todo records
 private async void DeleteTodoItem(TodoItem item)
 {
     await todoTable.DeleteAsync(item);
     items.Remove(item);
 }