Beispiel #1
0
        private void CloseAutoHideOverlay(AutoHideOverlay autoHideOverlay)
        {
            autoHideOverlay.Content = null;
            autoHideOverlay.Close();

            _autoHideOverlays.Remove(autoHideOverlay);
        }
Beispiel #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);
        }