Skip to content

Commit

Permalink
Applied fix to LayoutAnchorable drawn behind LayoutDocument since v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirkster99 committed Dec 12, 2017
1 parent fa81b3f commit 5a26eda
Showing 1 changed file with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,31 +99,30 @@ 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);
Win32Helper.BringWindowToTop(_internalHwndSource.Handle);
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)
{
Expand Down

0 comments on commit 5a26eda

Please sign in to comment.