/// <summary>
        /// Hide a dockable content removing it from its container <see cref="Pane"/>
        /// </summary>
        /// <param name="content">Content to hide</param>
        /// <remarks>Note that if you simply remove a content from its container without calling this method, the
        /// layout serializer component can't managed correctly the removed content.</remarks>
        internal void Hide(DockableContent content)
        {
            if (content.State == DockableContentState.Hidden)
            {
                DockableContents.Add(content);
                return;
            }

            if (!content.IsCloseable)
                return;

            if (content.State != DockableContentState.FloatingWindow &&
                content.State != DockableContentState.DockableWindow)
            {
                //save position only if hiding from a docked or autohidden pane
                content.SaveCurrentStateAndPosition();
            }

            if (content.State == DockableContentState.AutoHide)
            {
                HideFlyoutWindow();
                RemoveContentFromTabGroup(content);
            }

            if (content.State == DockableContentState.FloatingWindow ||
                content.State == DockableContentState.DockableWindow)
            {
                DockableFloatingWindow floatingWindow = Window.GetWindow(content) as DockableFloatingWindow;

                if (floatingWindow != null &&
                    (floatingWindow.Content as Pane).HasSingleItem &&
                    !floatingWindow.IsClosing)
                {
                    floatingWindow.Close();
                }
            }

            if (content.State != DockableContentState.Hidden)
            {
                DockableContents.Add(content);

                content.SetStateToHidden();
                content.DetachFromContainerPane();
            }

            if (ActiveDocument == content)
                ActiveDocument = null;

            if (ActiveContent == content)
                ActiveContent = null;
        }