示例#1
0
        public void ToFloat(bool isActive = true)
        {
            if (!CanFloat && isActive)
            {
                _dockControl.SetActive();
                return;
            }
            if (_container != null)
            {
                CanSelect = true;
                //注意切换模式
                Mode = DockMode.Float;
                var dockManager = DockManager;
                _container.Detach(this);
                _container = null;
                BaseFloatWindow  wnd;
                BaseGroupControl groupctrl;
                if (!IsDocument)
                {
                    var group = new LayoutGroup(Side, Mode, dockManager);
                    group.Attach(this);
                    groupctrl = new AnchorSideGroupControl(group)
                    {
                        DesiredHeight = DesiredHeight, DesiredWidth = DesiredWidth
                    };
                    wnd = new AnchorGroupWindow(dockManager)
                    {
                        Height = DesiredHeight,
                        Width  = DesiredWidth,
                        Left   = FloatLeft,
                        Top    = FloatTop
                    };
                }
                else
                {
                    var group = new LayoutDocumentGroup(Mode, dockManager);
                    group.Attach(this);
                    groupctrl = new LayoutDocumentGroupControl(group)
                    {
                        DesiredHeight = DesiredHeight, DesiredWidth = DesiredWidth
                    };
                    wnd = new DocumentGroupWindow(dockManager)
                    {
                        Height = DesiredHeight,
                        Width  = DesiredWidth,
                        Left   = FloatLeft,
                        Top    = FloatTop
                    };
                }
                wnd.AttachChild(groupctrl, AttachMode.None, 0);
                wnd.Show();

                if (isActive)
                {
                    _dockControl.SetActive();
                }
            }
        }
示例#2
0
        public override void ToFloat()
        {
            BaseFloatWindow  wnd;
            BaseGroupControl ctrl;
            BaseLayoutGroup  group;
            var dockManager = _dockManager;
            var children    = _children.ToList();
            var ele         = children.First();

            //hide all first
            foreach (var child in children)
            {
                Detach(child);
            }

            if (this is LayoutDocumentGroup)
            {
                group = new LayoutDocumentGroup(DockMode.Float, dockManager);
                foreach (var child in children)
                {
                    group.Attach(child);
                }

                ctrl = new LayoutDocumentGroupControl(group)
                {
                    DesiredHeight = ele.DesiredHeight, DesiredWidth = ele.DesiredWidth
                };
                wnd = new DocumentGroupWindow(dockManager)
                {
                    Height = ele.DesiredHeight,
                    Width  = ele.DesiredWidth,
                    Left   = ele.FloatLeft,
                    Top    = ele.FloatTop
                };
            }
            else
            {
                group = new LayoutGroup(_side, DockMode.Float, dockManager);
                foreach (var child in children)
                {
                    group.Attach(child);
                }

                ctrl = new AnchorSideGroupControl(group)
                {
                    DesiredHeight = ele.DesiredHeight, DesiredWidth = ele.DesiredWidth
                };
                wnd = new AnchorGroupWindow(dockManager)
                {
                    Height = ele.DesiredHeight,
                    Width  = ele.DesiredWidth,
                    Left   = ele.FloatLeft,
                    Top    = ele.FloatTop
                };
            }

            wnd.AttachChild(ctrl, AttachMode.None, 0);
            wnd.Show();

            dockManager.ActiveControl.SetActive();
        }