Exemplo n.º 1
0
        /// <summary>
        /// Remove a group of docking buttons from the relative border stack panel
        /// </summary>
        /// <param name="group">Group to remove</param>
        private void RemoveDockingButtons(DockingButtonGroup group)
        {
            foreach (DockingButton btn in group.Buttons)
                btn.MouseEnter -= new MouseEventHandler(OnShowAutoHidePane);

            switch (group.Dock)
            {
                case Dock.Left:
                    btnPanelLeft.Children.RemoveAt(btnPanelLeft.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelLeft.Children.Remove(btn);
                    break;
                case Dock.Right:
                    btnPanelRight.Children.RemoveAt(btnPanelRight.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelRight.Children.Remove(btn);
                    break;
                case Dock.Top:
                    btnPanelTop.Children.RemoveAt(btnPanelTop.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelTop.Children.Remove(btn);
                    break;
                case Dock.Bottom:
                    btnPanelBottom.Children.RemoveAt(btnPanelBottom.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelBottom.Children.Remove(btn);
                    break;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a group of docking buttons to the relative border stack panel
        /// </summary>
        /// <param name="group">Group to add</param>
        private void AddDockingButtons(DockingButtonGroup group)
        {
            foreach (DockingButton btn in group.Buttons)
            {
                btn.MouseEnter += new MouseEventHandler(OnShowAutoHidePane);
            }

            Border br = new Border();

            br.Width = br.Height = 10;
            switch (group.Dock)
            {
            case Dock.Left:
                foreach (DockingButton btn in group.Buttons)
                {
                    btn.LayoutTransform = new RotateTransform(90);
                    btnPanelLeft.Children.Add(btn);
                }
                btnPanelLeft.Children.Add(br);
                break;

            case Dock.Right:
                foreach (DockingButton btn in group.Buttons)
                {
                    btn.LayoutTransform = new RotateTransform(90);
                    btnPanelRight.Children.Add(btn);
                }
                btnPanelRight.Children.Add(br);
                break;

            case Dock.Top:
                foreach (DockingButton btn in group.Buttons)
                {
                    btnPanelTop.Children.Add(btn);
                }
                btnPanelTop.Children.Add(br);
                break;

            case Dock.Bottom:
                foreach (DockingButton btn in group.Buttons)
                {
                    btnPanelBottom.Children.Add(btn);
                }
                btnPanelBottom.Children.Add(br);
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Add a group of docking buttons for a pane docked to a dockingmanager border
        /// </summary>
        /// <param name="pane"></param>
        private void AddPaneDockingButtons(DockablePane pane)
        {
            DockingButtonGroup buttonGroup = new DockingButtonGroup();
            buttonGroup.Dock = pane.Dock;

            foreach (DockableContent content in pane.Contents)
            {
                DockingButton btn = new DockingButton();
                btn.DockableContent = content;
                btn.DockingButtonGroup = buttonGroup;

                if (_currentButton == null)
                    _currentButton = btn;

                buttonGroup.Buttons.Add(btn);
            }

            _dockingBtnGroups.Add(buttonGroup);

            AddDockingButtons(buttonGroup);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Remove a group of docking buttons from the relative border stack panel
        /// </summary>
        /// <param name="group">Group to remove</param>
        private void RemoveDockingButtons(DockingButtonGroup group)
        {
            foreach (DockingButton btn in group.Buttons)
                btn.MouseEnter -= new MouseEventHandler(OnShowAutoHidePane);

            switch (group.Dock)
            {
                case Dock.Left:
                    btnPanelLeft.Children.RemoveAt(btnPanelLeft.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelLeft.Children.Remove(btn);
                    break;
                case Dock.Right:
                    btnPanelRight.Children.RemoveAt(btnPanelRight.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelRight.Children.Remove(btn);
                    break;
                case Dock.Top:
                    btnPanelTop.Children.RemoveAt(btnPanelTop.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelTop.Children.Remove(btn);
                    break;
                case Dock.Bottom:
                    btnPanelBottom.Children.RemoveAt(btnPanelBottom.Children.IndexOf(group.Buttons[group.Buttons.Count - 1]) + 1);
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelBottom.Children.Remove(btn);
                    break;
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Add a group of docking buttons for a pane docked to a dockingmanager border
        /// </summary>
        /// <param name="pane"></param>
        private void AddPaneDockingButtons(DockablePane pane)
        {
            DockingButtonGroup buttonGroup = new DockingButtonGroup();
            buttonGroup.Dock = pane.Dock;

            foreach (DockableContent content in pane.Contents)
            {
                DockingButton btn = new DockingButton();
                btn.DockableContent = content;
                btn.DockingButtonGroup = buttonGroup;

                if (_currentButton == null)
                    _currentButton = btn;

                buttonGroup.Buttons.Add(btn);
            }

            _dockingBtnGroups.Add(buttonGroup);

            AddDockingButtons(buttonGroup);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Add a group of docking buttons to the relative border stack panel
        /// </summary>
        /// <param name="group">Group to add</param>
        private void AddDockingButtons(DockingButtonGroup group)
        {
            foreach (DockingButton btn in group.Buttons)
                btn.MouseEnter += new MouseEventHandler(OnShowAutoHidePane);

            Border br = new Border();
            br.Width = br.Height = 10;
            switch (group.Dock)
            {
                case Dock.Left:
                    foreach (DockingButton btn in group.Buttons)
                    {
                        btn.LayoutTransform = new RotateTransform(90);
                        btnPanelLeft.Children.Add(btn);
                    }
                    btnPanelLeft.Children.Add(br);
                    break;
                case Dock.Right:
                    foreach (DockingButton btn in group.Buttons)
                    {
                        btn.LayoutTransform = new RotateTransform(90);
                        btnPanelRight.Children.Add(btn);
                    }
                    btnPanelRight.Children.Add(br);
                    break;
                case Dock.Top:
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelTop.Children.Add(btn);
                    btnPanelTop.Children.Add(br);
                    break;
                case Dock.Bottom:
                    foreach (DockingButton btn in group.Buttons)
                        btnPanelBottom.Children.Add(btn);
                    btnPanelBottom.Children.Add(br);
                    break;
            }
        }