public FlipViewPostItem(IPanelHost host, PostCollector collector, Post post, string targetComment)
 {
     Context   = new FlipViewPostContext(host, collector, post, targetComment);
     IsVisible = false;
 }
        /// <summary>
        /// Fired when the Context property changes.
        /// </summary>
        /// <param name="newVis"></param>
        private void OnContextChanged(FlipViewPostContext newContext)
        {
            // Setup screen mode changing if not already.
            if (!m_isScrrenModeChangedSetup)
            {
                m_isScrrenModeChangedSetup = true;
                PanelContext.Host.OnScreenModeChanged += OnScreenModeChanged;
            }

            // When our context changes make sure our comments are reset
            ClearCommentManger();

            // If we should be prefetching comments do so now.
            if(LoadComments)
            {
                PreFetchPostComments();
            }

            // If we have a target comment show the UI now.
            if(!String.IsNullOrWhiteSpace(newContext.TargetComment))
            {
                newContext.Post.FlipViewShowEntireThreadMessage = Visibility.Visible;
            }

            // Setup the UI for the new context
            SetupListViewForNewContext();
            SetupHeaderForNewContext();
            SetupScreenModeForNewContext(newContext.Host.CurrentScreenMode());
            ShowCommentScrollTipIfNeeded();
            SetupFullScreenForNewContext();
        }
Beispiel #3
0
 public FlipViewPostItem(IPanelHost host, PostCollector collector, Post post, string targetComment)
 {
     Context = new FlipViewPostContext(host, collector, post, targetComment);
     IsVisible = false;
 }