/// <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); }
/// <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.SourceId = null; } m_contentControl = null; // Clear the UI ui_contentRoot.Children.Clear(); }