From 5a26edaef16063f01ca2d6a353a239ee84fa3c63 Mon Sep 17 00:00:00 2001 From: Dirkster99 Date: Tue, 12 Dec 2017 19:13:34 +0100 Subject: [PATCH] Applied fix to LayoutAnchorable drawn behind LayoutDocument since v3.1 https://github.com/xceedsoftware/wpftoolkit/issues/1178 --- .../Controls/LayoutAutoHideWindowControl.cs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs index b619156b..c059d558 100644 --- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs +++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutAutoHideWindowControl.cs @@ -99,7 +99,7 @@ protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(Syst Height = 0, }); - //_internalHost_ContentRendered = false; + _internalHost_ContentRendered = false; _internalHwndSource.ContentRendered += _internalHwndSource_ContentRendered; _internalHwndSource.RootVisual = _internalHostPresenter; AddLogicalChild(_internalHostPresenter); @@ -107,23 +107,22 @@ protected override System.Runtime.InteropServices.HandleRef BuildWindowCore(Syst return new HandleRef(this, _internalHwndSource.Handle); } - // private bool _internalHost_ContentRendered = false; + private bool _internalHost_ContentRendered = false; void _internalHwndSource_ContentRendered(object sender, EventArgs e) { - // _internalHost_ContentRendered = true; + _internalHost_ContentRendered = true; } - - //protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) - //{ - // if (msg == Win32Helper.WM_WINDOWPOSCHANGING) - // { - // if (_internalHost_ContentRendered) - // Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize); - // } - // return base.WndProc(hwnd, msg, wParam, lParam, ref handled); - //} + protected override IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) + { + if (msg == Win32Helper.WM_WINDOWPOSCHANGING) + { + if (_internalHost_ContentRendered) + Win32Helper.SetWindowPos(_internalHwndSource.Handle, Win32Helper.HWND_TOP, 0, 0, 0, 0, Win32Helper.SetWindowPosFlags.IgnoreMove | Win32Helper.SetWindowPosFlags.IgnoreResize); + } + return base.WndProc(hwnd, msg, wParam, lParam, ref handled); + } protected override void DestroyWindowCore(System.Runtime.InteropServices.HandleRef hwnd) {