/// <summary> /// Will remove any comment managers that may exist for a post, and clears the comments. /// </summary> /// <param name="post"></param> private void ClearCommentManger() { if(m_commentManager != null) { m_commentManager.PrepareForDeletion(); m_commentManager = null; } }
/// <summary> /// Creates a comment manager for the post and prefetches the comments /// </summary> /// <param name="post"></param> private void PreFetchPostComments(bool forcePreFetch = false, bool showThreadSubset = true) { // Make sure we aren't already ready. if(m_commentManager != null) { return; } FlipViewPostContext context = GetContext(); if(context == null) { return; } // Create a comment manager for the post Post refPost = context.Post; m_commentManager = new FlipViewPostCommentManager(ref refPost, context.TargetComment, showThreadSubset); // Set the comment list to the list view ui_listView.ItemsSource = m_commentManager.Comments; // If the user wanted, kick off pre load of comments. if (forcePreFetch || App.BaconMan.UiSettingsMan.FlipView_PreloadComments) { m_commentManager.PreFetchComments(); } }