private void OnAddCommentComplete(object sender, AddPhotoCommentCompleteEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                if (e.PhotoId != PhotoSource.ResourceId)
                    return;

                UpdateItemRenderers();
            });
        }
        private void OnPhotoCommentAdded(object sender, AddCommentEventArgs e)
        {
            Photo photo = Cinderella.CinderellaCore.PhotoCache[e.PhotoId];

            JObject rawJson = JObject.Parse(e.Response);
            string newCommentId = rawJson["comment"]["id"].ToString();

            PhotoComment newComment = new PhotoComment();
            newComment.ResourceId = newCommentId;
            newComment.Message = e.Message;
            newComment.Author = CurrentUser;
            newComment.CreationDate = DateTime.Now;

            photo.CommentCache[newCommentId] = newComment;
            photo.Comments.Insert(0, newComment);
            photo.CommentCount++;

            AddPhotoCommentCompleteEventArgs evt = new AddPhotoCommentCompleteEventArgs();
            evt.SessionId = e.SessionId;
            evt.PhotoId = photo.ResourceId;
            evt.NewComment = newComment;
            AddPhotoCommentCompleted.DispatchEvent(this, evt);
        }
        private void OnAddCommentComplete(object sender, AddPhotoCommentCompleteEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                if (composer == null || e.SessionId != addCommentSessionId)
                    return;

                DismissComposerView();
                dataSource.Insert(1, e.NewComment);
            });
        }