Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
303 views
in Technique[技术] by (71.8m points)

c# - WPF WebBrowser (3.5 SP1) Always on top - other suggestion to display HTML in WPF

I've been desperately looking for an easy way to display HTML in a WPF-application. There are some options:
1) use the WPF WebBrowser Control
2) use the Frame Control
3) use a third-party control

but, i've ran into the following problems: 1) the WPF WebBrowser Control is not real WPF (it is a Winforms control wrapped in WPF). I have found a way to create a wrapper for this and use DependencyProperties to navigate to HTML text with bindings and propertychanged. The problem with this is, if you put a Winforms control in WPF scrollviewer, it doesnt respect z-index, meaning the winform is always on top of other WPF control. This is very annoying, and I have tried to work around it by creating a WindowsFormsHost that hosts an ElemenHost etc.. but this completely breaks my binding obviously.

2) Frame Control has the same problems with displaying if it shows HTML content. Not an option.

3) I haven't found a native HTML-display for WPF. All options are winforms, and with the above mentioned problems.

the only way out I have at the moment is using Microsoft's buggy HtmlToXamlConverter, which crashes hard sometimes. (MSDN)

Does anybody have any other suggestions on how to display HTLM in WPF, without these issues?

sorry for the long question, hope anyone knows what i'm talking about...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

have you tried the Awesomium? please refer to : http://chriscavanagh.wordpress.com/2009/08/25/a-real-wpf-webbrowser/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...