protected override void OnNavigatedTo(NavigationEventArgs e) { _task = e.Parameter as Task; if (_task == null) return; Title.Text = _task.Title; Value.Text = _task.Value; }
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(); } }
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(); } }
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(); } }
private void OnTaskMoved(object sender, PointerRoutedEventArgs e) { var frameworkElement = sender as FrameworkElement; if (frameworkElement != null) { _taskSwipe = frameworkElement.DataContext as Task; } }