示例#1
0
        protected override void Redock()
        {
            if (_previousPane != null)
            {
                if (_previousPane.GetManager() == null)
                {
                    DockablePane newContainerPane = new DockablePane();
                    newContainerPane.Items.Add(HostedPane.RemoveContent(0));
                    newContainerPane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty));
                    newContainerPane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty));

                    if (_previousPane.Style != null)
                    {
                        newContainerPane.Style = _previousPane.Style;
                    }

                    Manager.Anchor(newContainerPane, ((DockablePane)_previousPane).Anchor);
                }
                else
                {
                    if (_arrayIndexPreviousPane > _previousPane.Items.Count)
                    {
                        _arrayIndexPreviousPane = _previousPane.Items.Count;
                    }

                    DockableContent currentContent = HostedPane.Items[0] as DockableContent;
                    _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0));
                    _previousPane.SelectedIndex = _arrayIndexPreviousPane;
                    currentContent.SetStateToDock();
                }
                this.Close();
            }

            base.Redock();
        }
示例#2
0
        public override Pane ClonePane()
        {
            DockablePane paneToAnchor = new DockablePane();

            //transfer the resizing panel sizes
            paneToAnchor.SetValue(ResizingPanel.ResizeWidthProperty,
                                  HostedPane.GetValue(ResizingPanel.ResizeWidthProperty));
            paneToAnchor.SetValue(ResizingPanel.ResizeHeightProperty,
                                  HostedPane.GetValue(ResizingPanel.ResizeHeightProperty));

            int selectedIndex = HostedPane.SelectedIndex;

            //transfer contents from hosted pane in the floating window and
            //the new created dockable pane
            while (HostedPane.Items.Count > 0)
            {
                paneToAnchor.Items.Add(
                    HostedPane.RemoveContent(0));
            }

            paneToAnchor.SelectedIndex = selectedIndex;

            return(paneToAnchor);
        }
        protected override void Redock()
        {
            if (_previousPane != null)
            {
                if (_previousPane.GetManager() == null)
                {
                    DockablePane newContainerPane = new DockablePane();
                    newContainerPane.Items.Add(HostedPane.RemoveContent(0));
                    newContainerPane.SetValue(ResizingPanel.ResizeWidthProperty, _previousPane.GetValue(ResizingPanel.ResizeWidthProperty));
                    newContainerPane.SetValue(ResizingPanel.ResizeHeightProperty, _previousPane.GetValue(ResizingPanel.ResizeHeightProperty));

                    if (_previousPane.Style != null)
                        newContainerPane.Style = _previousPane.Style;
                    
                    Manager.Anchor(newContainerPane, ((DockablePane)_previousPane).Anchor);
                }
                else
                {
                    if (_arrayIndexPreviousPane > _previousPane.Items.Count)
                        _arrayIndexPreviousPane = _previousPane.Items.Count;

                    DockableContent currentContent = HostedPane.Items[0] as DockableContent;
                    _previousPane.Items.Insert(_arrayIndexPreviousPane, HostedPane.RemoveContent(0));
                    _previousPane.SelectedIndex = _arrayIndexPreviousPane;
                    currentContent.SetStateToDock();

                }
                this.Close();
            } 
            
            base.Redock();
        }