private void ShowDetails(Task task)
 {
     currentTask = task;
     taskDialog = new TaskDialog(task);
     context = new BindingContext(this, taskDialog, taskDialog.Name);
     detailsScreen = new DialogViewController(context.Root, true);
     ActivateController(detailsScreen);
 }
Esempio n. 2
0
 private void SaveButtonOnClick(object sender, EventArgs e)
 {
     var task = new Task()
     {
         Id = todoId,
         Description = descriptionText.Text,
         Title = titleText.Text,
         Completed = taskCompleted.Checked
     };
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.SaveTask(task);
     Finish();
 }
 public void SaveTask()
 {
     context.Fetch();
     currentTask = new Task();
     currentTask.Id = taskDialog.Id;
     currentTask.Title = taskDialog.Name;
     currentTask.Description = taskDialog.Description;
     currentTask.Completed = taskDialog.Completed;
     NavigationController.PopViewController(true);
     CognitoSyncUtils utils = new CognitoSyncUtils();
     utils.SaveTask(currentTask);
     Refresh();
     currentTask = null;
 }
Esempio n. 4
0
        protected override void OnResume()
        {
            base.OnResume();

            todoId = Intent.GetStringExtra("todoItem");

            if (!string.IsNullOrEmpty(todoId))
            {
                CognitoSyncUtils utils = new CognitoSyncUtils();
                todoTask = utils.GetTask(todoId);
                if (todoTask != null)
                {
                    titleText.SetText(todoTask.Title, TextView.BufferType.Editable);
                    descriptionText.SetText(todoTask.Description, TextView.BufferType.Editable);
                    saveButton.Enabled = true;
                    deleteButton.Enabled = true;
                    taskCompleted.Checked = todoTask.Completed;
                }
            }
        }
        public void DeleteTask()
        {
            if (currentTask != null)
            {
				context.Fetch();
				NavigationController.PopViewController(true);
                CognitoSyncUtils utils = new CognitoSyncUtils();
				utils.DeleteTask(taskDialog.Id);
				Refresh();
				currentTask = null;
            }
        }
 public TaskDialog(Task task)
 {
     Id = task.Id;
     Name = task.Title;
     Description = task.Description;
     Completed = task.Completed;
 }
 public void SaveTask(Task task)
 {
     Dataset dataset = SyncManagerInstance.OpenOrCreateDataset(TASK_DATASET);
     var taskJson = JsonConvert.SerializeObject(task);
     dataset.Put(task.Id, taskJson);
 }