As far as I understand, WPF's Brwoser control is a wrapper of the ie Active-X control. The later has a BeforeNavigate2 Method, while I don't find this in the WPF WebBrowser control. Is there a way I can work around this?
Thx! Marc
As far as I understand, WPF's Brwoser control is a wrapper of the ie Active-X control. The later has a BeforeNavigate2 Method, while I don't find this in the WPF WebBrowser control. Is there a way I can work around this?
Thx! Marc
Yes. The WebBrowser control of WPF is really braindead. On top of that it is even sealed.
You have to use the WebBrowser control of Windows.Forms and embed it in a WindowsFormsHost.
Additionally you have to derive a class from WebBrowser and do some COM magic in it.
Make a UserControl like this:
Then modify Windows.Forms WebBrowser like this:
Then use WebBrowser (its named like that in XAML) from your code-behind and provide AdditionalHeaders with the required value.