private void OnResult(AnswersComment result)
 {
     if (result != null)
     {
         ViewModel.EditComment(result);
         QuestionsDetailsView.ScrollTo(ViewModel.AnswersComment.Last(), ScrollToPosition.Start, false);
     }
 }
Exemplo n.º 2
0
 public AnswersCommentPopupPage(QuestionsAnswers answers, Action <AnswersComment> result, AnswersComment answersComment = null)
 {
     this.answers        = answers;
     this.result         = result;
     this.answersComment = answersComment;
     InitializeComponent();
     BindingContext = new AnswersDetailsViewModel(answers);
     if (answersComment != null)
     {
         this.Comment.Text = answersComment.Content;
     }
     this.Comment.Focus();
 }
Exemplo n.º 3
0
        public void EditComment(AnswersComment comment)
        {
            var book = AnswersComment.Where(b => b.CommentID == comment.CommentID).FirstOrDefault();

            if (book == null)
            {
                AnswersComment.Add(comment);
                AnswersDetails.CommentDisplay = (answers.CommentCounts + 1).ToString();
            }
            else
            {
                var index = AnswersComment.IndexOf(book);
                AnswersComment[index] = comment;
            }
            if (LoadStatus == LoadMoreStatus.StausNodata)
            {
                LoadStatus = LoadMoreStatus.StausEnd;
            }
        }
Exemplo n.º 4
0
 private void ClosePopupPage(string result)
 {
     if (result != null)
     {
         if (answersComment == null)
         {
             answersComment = new AnswersComment();
             answersComment.PostUserInfo = new QuestionUserInfo()
             {
                 UserID   = UserSettings.Current.SpaceUserId,
                 IconName = UserSettings.Current.Avatar,
                 UCUserID = UserSettings.Current.UserId,
                 UserName = UserSettings.Current.DisplayName,
                 QScore   = UserSettings.Current.Score
             };
         }
         answersComment.Content   = result;
         answersComment.DateAdded = DateTime.Now;
         this.result.Invoke(answersComment);
     }
     PopupNavigation.PopAsync();
 }