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(); } }
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); }
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; }