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(); }
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(); } }
/// <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(); } }
/// <exclude /> protected override void OnPreviewMouseDown(MouseButtonEventArgs e) { base.OnPreviewMouseDown(e); DockItem selectedItem = SelectedItem; if (selectedItem != null && !HitTestTab(e.GetPosition(this))) { selectedItem.Activate(); } }
/// <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); } }
/// <exclude /> protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e) { base.OnMouseLeftButtonDown(e); MouseHoverTimer = null; DockItem.Activate(); }