We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ChromelessWindow with Frame

It seems that ChromelessWindow does not support Frame as content. ChromelessWindow does not display the Frame at all. But as I can see the Frame is still working because the mouse pointer changes its appearance based on its invisible content and I am able to open a link (invisible as well) in an external browser window. Is this a known issue?

Thanks,
Dominik

1 Reply

BA Balavasanth Syncfusion Team June 25, 2009 09:48 PM UTC

Hi Dominik,

Thanks for choosing Syncfusion products.

Please find the response for all your queries.

It seems that ChromelessWindow does not support Frame as content. ChromelessWindow does not display the Frame at all.

We would like to basically explain what the Frame control actually does in WPF. It actually supports the content navigation within content. So a Frame can be hosted within a Window, NavigationWindow, Page, UserControl, or a FlowDocument control. So we tried a sample using Frame by passing a page to its source and it works fine. You can see the code snippet as below

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="Window1">





You can also find the sample from the below mentioned location.

http://files.syncfusion.com/support/Tools.WPF/7.2.0.37/Forum-83267/main.htm

So we hope it is very clear now that chromeless window support Frame as a content and displays the Frame.

I can see the Frame is still working because the mouse pointer changes its appearance based on its invisible content and I am able to open a link (invisible as well) in an external browser window. Is this a known issue?

So now i can assume that your trying to host a webcontent as a source for the Frame in a chromeless window as something like below.

'>http://Syncfusion.com">

This will not work actually, see basically Frame uses the IE ActiveX control in the background to present the html code it gets. And, as all ActiveX controls, it doesn’t really like the way WPF deals with transparency. Lets explain in detail.

This is not the issue with the chromeless window, it is due to the Transparency problem with the WPF. See when the WPF Frame control used to display a web page, it hosts the native web browser control(IE). The web browser control is written using Win32, and draws itself in an HWND. WPF then hosts this HWND, but there are limitations around how deeply these two technologies can be integrated. Basically, the HWND is drawn on-top of everything else WPF draws. That works for many scenarios, but with transparent windows things get even more restricted. When WPF draws to a layered window, it renders into an off-screen bitmap, and then gives that bitmap to Windows to use on the screen. Unfortunately, this technique is not compatible with child HWNDs, so the web browser is unable to render anything. That is the reason you are not able to see the content. This problem isn't unique to Frame, it also happens with any embedded Windows Forms control, ActiveX control, etc.

WorkAround

We suggest a work around to this problem to use a "web browser" component that did not use an HWND to render itself, which will satisfy your requirement and solve your issue.

Still if you want only to use a Frame in the chromeless window we got a solution for this too.

Draw your frame on a non-transparent one, and then draw the latter on top of the original window, this logic can be easily achieved using the Interop.
Add the following two windows-calls will be necessary to draw the Frame onto the main window.

[DllImport("user32.dll")]
internal static extern bool ClientToScreen(IntPtr hWnd, ref DrawingPoint point);

[DllImport("user32.dll")]
internal static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);

All other things we have clearly explained in the sample. Kindly download the sample from the following location.

http://files.syncfusion.com/support/Tools.WPF/7.2.0.37/Forum-83267Updated/main.htm

Please let us know if you have any questions.

Regards,
Bala.








V

Loader.
Live Chat Icon For mobile
Up arrow icon