Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best control for rendering HTML content in WPF

My objective is to show the HTML content with style in my WPF application. I am getting a HTML content as response from a API. I need to show the content in a frame ( preferably textblock). I tried with webbrowser control of wpf where I faced many issues on formatting over the grid and I am not able to show transparent background for webbrowser control. I found the issue is due to this.

Sample HTML content :

<p>My <b>para<b></p><ul> <li>My list1</li> <li>My list2</li></ul>

I researched over the internet and found some control for wpf.

Awesomium

WPF Chromium

I am newbie to WPF C# and I don't have idea about how to use the controls in my wpf application. I tried with some sample application from here and here. However, It showing lot of error due to reference missing.

Also I tried with HtmltoXaml converter and WPF Rich box and found that it skips many of the content after rendering.

It would be really helpful for me if I get a simple sample wpf application working without error implemented with above mentioned controls or links that are useful.

Any new idea to overcome my issue also appreciated. Thanks in advance and sorry for my English.

like image 635
Gopichandar Avatar asked Nov 10 '22 20:11

Gopichandar


1 Answers

If you need a html5 rendering browser, I'd recommend CEFSharp. It's nugettable, stable and is synced with the latest Chromium code.

like image 93
penderi Avatar answered Nov 15 '22 06:11

penderi