0

I've recently stumbled across WebBrowser WPF control. I am interested if there are any limitations when building user interfaces with HTML+CSS+JS and embedding them in WebBrowser.

So far I've successfully

Is there any reason for not using WebBrowser to create simple apps? I am intersted in parts that absolutely need to be handled with some WPF code and cannot be bridged using WebBrowser.

sanjihan
  • 5,592
  • 11
  • 54
  • 119
  • 1
    The possible limitations depend on your app requirements. Under the hood `WebBrowser` uses IE engine, you have to enable an emulation feature for the latest installed IE version, and use `http-equiv="X-UA-Compatible" content="IE=edge"` meta tag on your web page, per this [thread](https://stackoverflow.com/questions/6771258/what-does-meta-http-equiv-x-ua-compatible-content-ie-edge-do) Also, you'll probably face with a COM interop at lot, in case of writing something more complicated, than MSDN samples – Pavel Anikhouski Jan 04 '20 at 10:14
  • 1
    If you want to design your UI with `HTML+CSS+JS ` why not using `Electron` instead? – Eldar Jan 04 '20 at 11:12
  • Thanks. I only need simple UI functionality. Electron unfortunately comes with 140 MB of baggage. – sanjihan Jan 04 '20 at 11:16
  • 140 MB rounded is 0 GB. That's not a real argument, WPF needs the .net framework. – H H Jan 04 '20 at 11:28
  • .net framework comes preinstalled on windows. I only need simple UI functionality. 140MB (or 70 compressed) for a to-do-list app is an overkill I find hard to explain to the end user – sanjihan Jan 04 '20 at 11:32
  • 1
    If this is something you're going to write then why isn't it all wpf and no webbrowser? Building a web page to interact with indirectly in a rather clunky manner doesn't seem like an obvious plan to me. Even if you're totally new to wpf, simple ui doesn't sound too hard. – Andy Jan 04 '20 at 13:51

0 Answers0