Exemplo n.º 1
0
        private void CloseAutoHidePane(AutoHidePane autoHidePane)
        {
            autoHidePane.Hide();
            var dockControl = DockHelper.GetDockControl(this);

            if (dockControl != null && autoHidePane.IsKeyboardFocusWithin)
            {
                // AutoHidePane still has focus, but it is moved out of the visible area.
                // --> Move focus back to DockControl.
                dockControl.Focus();
            }
        }
Exemplo n.º 2
0
        internal AutoHidePane ShowAutoHidePane(IDockTabPane dockTabPane, IDockTabItem dockTabItem, bool focus)
        {
            if (dockTabPane == null || !Items.Contains(dockTabPane))
            {
                return(null);
            }

            var dockControl = DockHelper.GetDockControl(this);

            // Ensure that correct item is selected.
            if (dockTabItem != null)
            {
                Debug.Assert(dockTabPane.Items.Contains(dockTabItem));
                dockTabPane.SelectedItem = dockTabItem;
            }

            // Get or create AutoHidePane that shows the DockTabItem.
            var autoHidePane = GetAutoHidePane(dockTabPane);

            if (autoHidePane == null)
            {
                // Create a new AutoHidePane if necessary.
                autoHidePane = new AutoHidePane
                {
                    Content = dockTabPane,
                    Dock    = Dock,
                };
                var autoHideOverlay = new AutoHideOverlay(dockControl, TargetArea)
                {
                    Content = autoHidePane
                };
                autoHideOverlay.Show();
                _autoHideOverlays.Add(autoHideOverlay);
            }

            // Slide-in AutoHidePane.
            autoHidePane.Show();

            if (focus)
            {
                dockControl?.DockStrategy?.Activate(dockTabPane);
            }

            return(autoHidePane);
        }
Exemplo n.º 3
0
 private void CloseAutoHidePane(AutoHidePane autoHidePane)
 {
     autoHidePane.Hide();
     var dockControl = DockHelper.GetDockControl(this);
     if (dockControl != null && autoHidePane.IsKeyboardFocusWithin)
     {
         // AutoHidePane still has focus, but it is moved out of the visible area.
         // --> Move focus back to DockControl.
         dockControl.Focus();
     }
 }
Exemplo n.º 4
0
        internal AutoHidePane ShowAutoHidePane(IDockTabPane dockTabPane, IDockTabItem dockTabItem, bool focus)
        {
            if (dockTabPane == null || !Items.Contains(dockTabPane))
                return null;

            var dockControl = DockHelper.GetDockControl(this);

            // Ensure that correct item is selected.
            if (dockTabItem != null)
            {
                Debug.Assert(dockTabPane.Items.Contains(dockTabItem));
                dockTabPane.SelectedItem = dockTabItem;
            }

            // Get or create AutoHidePane that shows the DockTabItem.
            var autoHidePane = GetAutoHidePane(dockTabPane);
            if (autoHidePane == null)
            {
                // Create a new AutoHidePane if necessary.
                autoHidePane = new AutoHidePane
                {
                    Content = dockTabPane,
                    Dock = Dock,
                };
                var autoHideOverlay = new AutoHideOverlay(dockControl, TargetArea)
                {
                    Content = autoHidePane
                };
                autoHideOverlay.Show();
                _autoHideOverlays.Add(autoHideOverlay);
            }

            // Slide-in AutoHidePane.
            autoHidePane.Show();

            if (focus)
                dockControl?.DockStrategy?.Activate(dockTabPane);

            return autoHidePane;
        }