public MoreActionViewModel(Listing<Comment> parent, int indentLevel, FlatCommentCollection listParent) : base()
        {
            _isInProcess = false;
            _parent = parent;
            _indentLevel = indentLevel;
            _listParent = listParent;

            _loadMore = new RelayCommand(LoadMoreAction);
        }
        public NewCommentViewModel(string parentId, int indentLevel, FlatCommentCollection parentList)
            : base()
        {
            _parentId = parentId;
            _indentLevel = indentLevel;
            _parentList = parentList;

            _newCommentText = "";

            _dismiss = new RelayCommand(DismissAction);
            _post = new RelayCommand(PostAction);
        }
Ejemplo n.º 3
0
        public CommentViewModel(Comment c, int indentLevel, FlatCommentCollection parent)
            : base()
        {
            _comment = c;
            _indentLevel = indentLevel;
            _isSelected = false;
            _parent = parent;

            _upvote = new RelayCommand(UpvoteAction);
            _downvote = new RelayCommand(DownvoteAction);
            _addComment = new RelayCommand(AddCommentAction);
        }
Ejemplo n.º 4
0
        public PostViewModel(Post post)
        {
            _post = post;
            _comments = new FlatCommentCollection(_post.Comments);

            _comments.EditBoxAdded += delegate(object sender, EditBoxAddedEventArgs e)
            {
                this.CurrentEditBox = e.NewCommentViewModel;
            };

            _upvote = new RelayCommand(UpvoteAction);
            _downvote = new RelayCommand(DownvoteAction);
            _addComment = new RelayCommand(AddCommentAction);
        }
 private void DismissAction()
 {
     if (_parentList != null)
     {
         _parentList.Remove(this);
         _parentList = null;
     }
 }