示例#1
0
        private void UpdateListComments()
        {
            var comments = CommonMethods.SafeRunMethod.WithReturn(() => httpClientProvider.GetDatabaseCommentReader().GetFromTask(thisTask.TaskId));

            if (comments == null)
            {
                return;
            }

            StackPanelComments.Children.Clear();
            foreach (var commentControl in comments.Select(comment => new CommentControl(httpClientProvider, comment)))
            {
                commentControl.AddComment    += (sender, args) => UpdateListComments();
                commentControl.EditComment   += (sender, args) => UpdateListComments();
                commentControl.DeleteComment += (sender, args) => UpdateListComments();
                StackPanelComments.Children.Add(commentControl);
            }
        }