Esempio n. 1
0
        //点击修改评论按键
        private async void edit(object sender, RoutedEventArgs e)
        {
            dynamic temp = e.OriginalSource;

            selectedItem = temp.DataContext;
            Comment.Text = selectedItem.comment;
            await CommentDialog.ShowAsync();
        }
Esempio n. 2
0
        private void ChangeAbsence(Resource employee)
        {
            var dialog = new CommentDialog(employee.Name, employee.Job);

            if (dialog.ShowDialog() == true)
            {
                employee.Comment = dialog.Comment;
            }
        }
        private async Task ToggleCommentDialogVisibility(bool visible)
        {
            if (visible)
            {
                CommentDialog.SetVisualOpacity(0);
                CommentDialog.Visibility = Visibility.Visible;
                await CommentDialog.StartCompositionFadeScaleAnimationAsync(0, 1, 1.1f, 1, 150, null, 0, EasingFunctionNames.SineEaseInOut);
            }
            else
            {
                await CommentDialog.StartCompositionFadeScaleAnimationAsync(1, 0, 1, 1.1f, 150, null, 0, EasingFunctionNames.SineEaseInOut);

                CommentDialog.Visibility = Visibility.Collapsed;
            }
        }
Esempio n. 4
0
        private async void AddCommentButton_Click(object sender, RoutedEventArgs e)
        {
            CommentDialog commentDialog = new CommentDialog();
            var           dialogResult  = await commentDialog.ShowAsync();

            if (dialogResult == ContentDialogResult.Primary)
            {
                string text;
                commentDialog.Comment.GetText(Windows.UI.Text.TextGetOptions.FormatRtf, out text);

                if (requirement.comments == null)
                {
                    requirement.comments = new List <RequirementCommentAPI>();
                }

                requirement.comments.Add(new RequirementCommentAPI {
                    comment = text
                });
            }
        }
Esempio n. 5
0
        private async Task ToggleCommentDialogVisibility(bool visible)
        {
            if (visible)
            {
                CommentDialog.Opacity    = 0;
                CommentDialog.Visibility = Visibility.Visible;

                await CommentDialog.Animation()
                .Opacity(0, 1)
                .Scale(1.1f, 1, Easing.SineEaseInOut)
                .Duration(150)
                .StartAsync();
            }
            else
            {
                await CommentDialog.Animation()
                .Opacity(1, 0)
                .Scale(1, 1.1f, Easing.SineEaseInOut)
                .Duration(150)
                .StartAsync();

                CommentDialog.Visibility = Visibility.Collapsed;
            }
        }