Ejemplo n.º 1
0
        private void _ToRoot(DockManager dockManager)
        {
            Mode = DockMode.Normal;
            var group = new LayoutGroup(Side, Mode, dockManager);

            group.Attach(this);
            var groupctrl = new AnchorSideGroupControl(group)
            {
                DesiredHeight = DesiredHeight, DesiredWidth = DesiredWidth
            };

            switch (Side)
            {
            case DockSide.Left:
                dockManager.LayoutRootPanel.RootGroupPanel.AttachChild(groupctrl, AttachMode.Left, 0);
                break;

            case DockSide.Right:
                dockManager.LayoutRootPanel.RootGroupPanel.AttachChild(groupctrl, AttachMode.Right, dockManager.LayoutRootPanel.RootGroupPanel.Count);
                break;

            case DockSide.Top:
                dockManager.LayoutRootPanel.RootGroupPanel.AttachChild(groupctrl, AttachMode.Top, 0);
                break;

            case DockSide.Bottom:
                dockManager.LayoutRootPanel.RootGroupPanel.AttachChild(groupctrl, AttachMode.Bottom, dockManager.LayoutRootPanel.RootGroupPanel.Count);
                break;
            }
        }
Ejemplo n.º 2
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();
                }
            }
        }
Ejemplo n.º 3
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();
        }