private void AttachWindow(Window window)
{
Debug.WriteLine("ChromeWorker attached.");
_contentWindow = window;
_borderWindow = new LegacyBorderWindow(window);
_contentWindow.Closed += _contentWindow_Closed;
_contentWindow.ContentRendered += _contentWindow_ContentRendered;
var hwnd = new WindowInteropHelper(_contentWindow).Handle;
if (hwnd == IntPtr.Zero)
{
_contentWindow.SourceInitialized += window_SourceInitialized;
}
else
{
InitReal(hwnd);
}
}