コード例 #1
0
        private async void AddTaskAsync()
        {
            IsLoading = true;

            // Reset the text box.
            var text = TaskText;

            TaskText = "";

            // Create the request object.
            var task = new TaskModel
            {
                AssignedTo = _configService.User.Id,
                PlanId     = _groupPlan.Id,
                BucketId   = _taskBucket.Id,
                Title      = text
            };

            // Add the task.
            task = await _graphService.AddTaskAsync(task);

            Tasks.Add(task);
            OnTasksChanged();
            IsLoading = false;
        }
コード例 #2
0
        private async void AddTaskAsync()
        {
            IsLoading = true;

            // Reset the text box.
            var text = TaskText;

            TaskText = "";

            dynamic assignments     = new ExpandoObject();
            var     assignmentsDict = assignments as IDictionary <string, object>;

            assignmentsDict[_configService.User.Id] = new PlannerAssignment()
            {
                OrderHint = Constants.PlannerAssignmentOrderHint
            };

            // Create the request object.
            var task = new TaskModel
            {
                Assignments = assignments,
                PlanId      = _groupPlan.Id,
                BucketId    = _taskBucket.Id,
                Title       = text
            };

            // Add the task.
            task = await _graphService.AddTaskAsync(task);

            Tasks.Add(task);
            OnTasksChanged();
            IsLoading = false;
        }