示例#1
0
        private async void ReplyComment_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var menuItem = sender as MenuFlyoutItem;

            if (menuItem == null)
            {
                return;
            }

            var comment = menuItem.DataContext as Comment;

            if (comment == null)
            {
                return;
            }

            var dialog = new UgcDialog(String.Format("回复 {0} 评论", comment.Author.Name), "发布", "取消");
            await dialog.ShowAsync();

            var rslt = dialog.Result;

            if (rslt.Canceled == true)
            {
                return;
            }

            var vm = this.DataContext as ArticleViewModel;

            vm.CurrentComment = comment;

            vm?.ReplyComment.Execute(rslt.Content);
        }
示例#2
0
        private async void CommentButton_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var dialog = new UgcDialog("添加评论", "发布", "取消");
            await dialog.ShowAsync();

            var rslt = dialog.Result;

            if (rslt.Canceled == true)
            {
                return;
            }

            var vm = this.DataContext as ArticleViewModel;

            vm?.CommentArticle.Execute(rslt.Content);
        }
示例#3
0
        private async void Answer_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var dialog = new UgcDialog("添加回答", "发布", "取消", true, true, true);
            await dialog.ShowAsync();

            var rslt = dialog.Result;

            if (rslt.Canceled == true)
            {
                return;
            }

            var vm = ViewModelHelper.Instance.GetQuestion(_questionId);

            if (rslt.Anonymited)
            {
                vm.AnonymousCommand.Execute(null);
            }
            vm.CreateAnswer.Execute(rslt.Content);
        }