コード例 #1
0
        /// <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 (State != GlobalContentStates.Idle)
                {
                    return;
                }
                State = GlobalContentStates.Opening;
            }

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

            // Disable full screen
            m_contentControl.CanGoFullscreen = false;

            // This isn't great, but for now mock a post
            m_source = ContentPanelSource.CreateFromUrl(link);

            // Approve the content to be shown
            Task.Run(() =>
            {
                ContentPanelMaster.Current.AddAllowedContent(m_source);
            });

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

            // Set the post to begin loading
            m_contentControl.SourceId  = m_source.Id;
            m_contentControl.IsVisible = true;

            // Show the panel
            ToggleShown(true);
        }