I'd like to show an html document in the documentViewer control. How should it be done? I've searched for any examples with no success. Any idea would be apreciated.
Asked
Active
Viewed 5,214 times
1 Answers
2
DocumentViewer
is designed to show XAML documents, not HTML. Use a WebBrowser
or Frame
instead

Thomas Levesque
- 286,951
- 70
- 623
- 758
-
2WebBorwser and Frame (when showing HTML) do not work well at all in WPF. Both are dependent on the IE ActiveX control. Therefore, they cannot be integrated with any alpha blending (transparency or opacity). It seems that if you want to use HTML within WPF you either have to use a MAJOR HACK, or make your applicaiton look like a WinForms app (no alpha). Anyone else think that this is just too stupid!? My thoughts are that this has to do with the anti-trust stuff. – Jordan Jan 04 '11 at 17:30
-
2Yes, that's a known limitation. And I don't think it has anything to do with the "anti-trust stuff", it's just that there is no pure WPF web browser... Making a web browser is *hard*, so it's quite natural to use the existing one, although I agree it's not an ideal option. The future version of WPF should bring some improvements in this area (but it will still be dependent on IE). – Thomas Levesque Jan 04 '11 at 18:40
-
BTW, you might be interested in [this link](http://chriscavanagh.wordpress.com/2009/08/25/a-real-wpf-webbrowser/). It's a WPF browser based on Chromium, and it supports alpha blending and effects – Thomas Levesque Jan 04 '11 at 18:41
-
How ironic, microsoft makes us to use it's competitor (chromium) in all WPF apps. – Poma Feb 06 '12 at 10:13