/// <summary>
        /// Called when we should show something
        /// </summary>
        /// <param name="link"></param>
        public void ShowContent(string link)
        {
            // Make sure we are in the correct state
            lock(this)
            {
                if(m_state != State.Idle)
                {
                    return;
                }
                m_state = State.Opening;
            }

            // Create the content control
            m_contentControl = new FlipViewContentControl();

            // This isn't great, but for now mock a post
            Post post = new Post() { Url = link, Id = "quinn" };

            // Add the control to the UI
            ui_contentRoot.Children.Add(m_contentControl);

            // Set the post to begin loading
            m_contentControl.FlipPost = post;
            m_contentControl.IsVisible = true;

            // Show the panel
            ToggleShown(true);
        }
        /// <summary>
        /// Called when the close animation is complete
        /// </summary>
        private void CloseComplete()
        {
            // Hide the UI
            ui_background.Visibility = Visibility.Collapsed;
            ui_mainHolder.Visibility = Visibility.Collapsed;

            // Kill the story
            if(m_contentControl != null)
            {
                m_contentControl.FlipPost = null;
            }
            m_contentControl = null;

            // Clear the UI
            ui_contentRoot.Children.Clear();
        }
        /// <summary>
        /// Fired when the control wants to go full screen.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FlipViewContentControl_OnToggleFullscreen(object sender, FlipViewContentControl.OnToggleFullScreenEventArgs e)
        {
            // Get the post
            Post post = ((Post)((FrameworkElement)sender).DataContext);

            // Set if we are full screen or not.
            m_isFullScreen = e.GoFullScreen;

            // Hide or show the header
            if (e.GoFullScreen == (post.FlipviewHeaderVisibility == Visibility.Visible))
            {
                ToggleHeader(post);
            }

            // #todo scroll comments to the top so they aren't visible?
        }
Example #4
0
        /// <summary>
        /// Fired when the control wants to go full screen.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FlipViewContentControl_OnToggleFullscreen(object sender, FlipViewContentControl.OnToggleFullScreenEventArgs e)
        {
            // Get the post
            Post post = ((Post)((FrameworkElement)sender).DataContext);

            // Hide or show the header
            // #todo, animate this
            post.IsPostHeaderVisible = e.GoFullScreen ? Visibility.Collapsed : Visibility.Visible;

            // #todo scroll comments to the top so they aren't visible?
        }