diff --git a/source/Components/AvalonDock/Controls/DragService.cs b/source/Components/AvalonDock/Controls/DragService.cs index 2b5d18e8..96e6c641 100644 --- a/source/Components/AvalonDock/Controls/DragService.cs +++ b/source/Components/AvalonDock/Controls/DragService.cs @@ -196,6 +196,7 @@ internal void UpdateMouseLocation(Point dragPosition) if (_currentDropTarget != null) { _currentWindow.DragEnter(_currentDropTarget); + BringWindowToTop2((Window)_currentWindow); return; } }); @@ -278,6 +279,8 @@ internal void Abort() private void BringWindowToTop2(Window window) { + if (window == null) return; + Win32Helper.SetWindowPos(new WindowInteropHelper(window).Handle, IntPtr.Zero, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreResize | Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.DoNotActivate); }