/// <summary> /// Fired when the show is complete /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ShowCommentBox_Completed(object sender, object e) { // Fire the event. CommentBoxOnOpenedArgs args = new CommentBoxOnOpenedArgs() { Context = m_context, RedditId = m_itemRedditId }; m_onBoxOpened.Raise(this, args); }
/// <summary> /// Fired when the comment box is done opening. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommentBox_OnBoxOpened(object sender, CommentBoxOnOpenedArgs e) { OnOpenCommentBox openBoxContext = (OnOpenCommentBox)e.Context; if(openBoxContext != null) { // Replace the context e.Context = openBoxContext.Context; openBoxContext.CommentBoxOpened(sender, e); } }
/// <summary> /// Fired when the comment box is done opening. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void CommentBox_OnBoxOpened(object sender, CommentBoxOnOpenedArgs e) { // We want to scroll the comment we are working off of into view. if (e.RedditId.StartsWith("t1_")) { Comment comment = (Comment)e.Context; ui_listView.ScrollIntoView(comment); } }
/// <summary> /// Fired when the comment box is open. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ReplyBox_OnBoxOpened(object sender, CommentBoxOnOpenedArgs e) { // Scroll the message we are responding into view. ui_messageList.ScrollIntoView((Message)e.Context); }
/// <summary> /// Fired when the comment box is done opening. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void CommentBox_OnBoxOpened(object sender, CommentBoxOnOpenedArgs e) { // We want to scroll the comment we are working off of into view. if(e.RedditId.StartsWith("t1_")) { Comment comment = (Comment)e.Context; foreach (WeakReference<EndDetectingListView> weakList in m_currentListViews) { EndDetectingListView currentList = null; weakList.TryGetTarget(out currentList); if(currentList != null) { Post post = (Post)currentList.DataContext; if (post.Id.Equals(comment.LinkId.Substring(3))) { currentList.ScrollIntoView(comment); } } } } }