コード例 #1
0
ファイル: DockPaneManager.cs プロジェクト: grautvornix/Bite
        internal void OnDockItemStateChanged(DockItemStateEventArgs e)
        {
            if (_isDockItemStateChanging)
            {
                if (FlagSaveFocus)
                {
                    DockItem focusedItem = FocusedItem;
                    if (focusedItem.IsAutoHide)
                    {
                        _activatedPanes.Remove(focusedItem.FirstPane);
                    }

                    CoerceValues();

                    DockItem activeItem = ActiveItem;
                    if (activeItem != null)
                    {
                        activeItem.Activate();
                    }
                    else if (focusedItem != null)
                    {
                        FocusedItem = null;
                    }

                    _saveFocusItem = null;
                }
                CoerceValues();
                _isDockItemStateChanging = false;
            }
            _dockControl.OnDockItemStateChanged(e);
            RaiseEvents();
        }
コード例 #2
0
ファイル: WindowSwitcher.cs プロジェクト: grautvornix/Bite
        private void DoClose()
        {
            if (IsKeyboardFocusWithin)
            {
                DockItem         dockItemToActivate = DockControl.ActiveItem;
                FrameworkElement focusedElement     = Keyboard.FocusedElement as FrameworkElement;
                if (focusedElement != null)
                {
                    DockItem item = focusedElement.DataContext as DockItem;
                    if (item != null)
                    {
                        dockItemToActivate = item;
                    }
                }
                if (dockItemToActivate != null)
                {
                    dockItemToActivate.Activate();
                }
            }

            if (_floatingWindowAdorner != null)
            {
                FloatingWindowAdorner.Remove(DockControl, _floatingWindowAdorner);
            }
            else
            {
                Window.GetWindow(this).Close();
            }
        }
コード例 #3
0
ファイル: WpfFloatingWindow.cs プロジェクト: grautvornix/Bite
 /// <exclude />
 protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
 {
     base.OnPreviewMouseDown(e);
     if (FloatingWindow != null && FloatingWindow.ActivePanes.Count > 0)
     {
         DockPaneCollection activePanes    = FloatingWindow.ActivePanes;
         DockItem           itemToActivate = activePanes[activePanes.Count - 1].SelectedItem;
         itemToActivate.Activate();
     }
 }
コード例 #4
0
        /// <exclude />
        protected override void OnPreviewMouseDown(MouseButtonEventArgs e)
        {
            base.OnPreviewMouseDown(e);

            DockItem selectedItem = SelectedItem;

            if (selectedItem != null && !HitTestTab(e.GetPosition(this)))
            {
                selectedItem.Activate();
            }
        }
コード例 #5
0
        /// <exclude />
        protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
        {
            base.OnMouseLeftButtonDown(e);
            if (e.Handled)
            {
                return;
            }

            if (e.ClickCount == 1)
            {
                DockItem dockItem = DockItem;
                if (dockItem != null)
                {
                    dockItem.Activate();
                    UpdateLayout(); // Fix in 2.0.4846: this can avoid unnecessary mouse move event caused by layout change
                }
                DockManager.BeginDrag(this, this, e);
                e.Handled = true;
            }
            else if (e.ClickCount == 2)
            {
                e.Handled = DockCommands.Execute(this, DoubleClickCommand);
            }
        }
コード例 #6
0
 /// <exclude />
 protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
 {
     base.OnMouseLeftButtonDown(e);
     MouseHoverTimer = null;
     DockItem.Activate();
 }