/// <summary>
        /// 当因关闭导致的控件销毁时候进行重新创建
        /// </summary>
        /// <param name="usd"></param>
        /// <returns></returns>
        internal bool AddUserControl(UserControlExtend usd)
        {
            if (usd.Element != null)
            {
                usd.Element = null;
            }
            LayoutElement le = layoutContents[usd.Layout];

            if (le as LayoutAnchorablePane != null)
            {
                LayoutAnchorable lable = AddLayoutAnchorable(le as LayoutAnchorablePane, usd.Title);
                lable.Content = usd.UserExtend as FrameworkElement;
                usd.Element   = lable;
            }
            else if (le as LayoutDocumentPane != null)
            {
                LayoutDocument lable = AddDocument(le as LayoutDocumentPane, usd.Title);
                lable.Content = usd.UserExtend as FrameworkElement;
                usd.Element   = lable;
            }
            else if (le as LayoutAnchorGroup != null)
            {
                LayoutAnchorable lable = AddLayoutAnchorable(le as LayoutAnchorGroup, usd.Title);
                lable.Content = usd.UserExtend as FrameworkElement;
                usd.Element   = lable;
            }
            return(true);
        }
        /// <summary>
        /// 显示key的面板
        /// </summary>
        /// <param name="key"></param>
        public void ShowPane(string key)
        {
            if (userControlExtend.ContainsKey(key))
            {
                UserControlExtend userControl = userControlExtend[key];
                if (layoutContents[userControl.Layout].Parent == null)
                {
                    switch (userControl.Layout)
                    {
                    case Layout.LeftUp:
                        LeftAnchorableGroup.Children.Add(LeftUpPaneGroup);
                        break;

                    case Layout.LeftDown:
                        LeftAnchorableGroup.Children.Add(LeftDownPaneGroup);
                        break;

                    case Layout.Right:
                        RightAnchorableGroup.Children.Add(RightPaneGroup);
                        break;

                    case Layout.Buttom:
                        ButtonAnchorableGroup.Children.Add(ButtonPanelGroup);
                        break;

                    case Layout.Content:
                        MainParent.Children.Add(MainDocument);
                        break;

                    case Layout.TopSide:
                        TopSideParent.Children.Add(TopSideGroup);
                        break;

                    case Layout.LeftSide:
                        LeftSideParent.Children.Add(LeftSideGroup);
                        break;

                    case Layout.RightSide:
                        RightSideParent.Children.Add(RightSideGroup);
                        break;

                    case Layout.ButtomSide:
                        ButtomSideParent.Children.Add(ButtomSideGroup);
                        break;

                    default:
                        break;
                    }
                }
                if (ShowPane(userControl.Element) == false)
                {
                    if (IsContains(userControlExtend[key].Element, userControlExtend[key].Layout) == false)
                    {
                        AddUserControl(userControlExtend[key]);
                    }
                }
            }
        }
 /// <summary>
 /// 设置控件浮动
 /// </summary>
 /// <param name="key"></param>
 /// <param name="rect"></param>
 public void SetControlFloat(string key, Rect rect)
 {
     if (userControlExtend.ContainsKey(key))
     {
         UserControlExtend userControl = userControlExtend[key];
         userControl.Element.FloatingLeft   = rect.X;
         userControl.Element.FloatingTop    = rect.Y;
         userControl.Element.FloatingWidth  = rect.Width;
         userControl.Element.FloatingHeight = rect.Height;
         userControl.Element.Float();
     }
 }
        /// <summary>
        /// 添加一个控件
        /// </summary>
        /// <param name="key"></param>
        /// <param name="element"></param>
        /// <param name="layout"></param>
        public bool AddUserControl(string key, FrameworkElement element, Layout layout, string name)
        {
            if (userControlExtend.ContainsKey(key))
            {
                return(false);
            }
            UserControlExtend usd = new UserControlExtend()
            {
                Layout     = layout,
                UserExtend = element,
                Title      = name,
            };

            userControlExtend.Add(key, usd);
            return(AddUserControl(usd));
        }