protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     _task = e.Parameter as Task;
     if (_task == null) return;
     Title.Text = _task.Title;
     Value.Text = _task.Value;
 }
Exemple #2
0
 public async void Add(Task task)
 {
     var result = _client.SendTask(JsonConvert.SerializeObject(task));
     if (result) {
         GetTasks(task.OwnerId);
     }
     else
     {
         await new MessageDialog("There was a problem adding new task. Please try later.", "Sync error").ShowAsync();
     }
 }
Exemple #3
0
 public async void UpdateTask(Task task, string ownerId = "")
 {
     var result = _client.UpdateTask(task.Id, JsonConvert.SerializeObject(task));
     if (result)
     {
         GetTasks(ownerId);
     }
     else
     {
         await new MessageDialog("There was a problem removing task. Please try later.", "Sync error").ShowAsync();
     }
 }
Exemple #4
0
 public async void RemoveTask(Task task)
 {
     var result = _client.RemoveTask(task.Id);
     if (result)
     {
         TasksList.Remove(task);
         MainPage.SaveData(TasksList);
     }
     else
     {
         await new MessageDialog("There was a problem removing task. Please try later.", "Sync error").ShowAsync();
     }
 }
Exemple #5
0
 private void OnTaskMoved(object sender, PointerRoutedEventArgs e)
 {
     var frameworkElement = sender as FrameworkElement;
     if (frameworkElement != null)
     {
         _taskSwipe = frameworkElement.DataContext as Task;
     }
 }