views:

359

answers:

1

Is it possible to interact with the source code of a local or remote page in real time through the use of the WPF browser control.

A simple example of what I mean would be where the user can click a button that will bold the selected text. Sort of like a WYSIWYG HTML editor but using the browser control.

Is there a way to interact with the source code like this with the same power you have with JavaScript. Would one have to set up a system to parse the selected web page and then modify its code and then reopen the new code in the browser control to simulate the experience of real time editing?

Thanks

A: 

You have full DOM access through the webbrowser control, so the answer is yes. However, the webbrowser control is not a wpf control but a winforms control, and in order to use it you would have to use the wpf winforms container control.

klausbyskov
No, there's a WPF WebBrowser control as well, as of .NET 3.5 SP1. (It wraps the same underlying ActiveX control though; just doesn't require WinForms interop.)
itowlson
To add to Klaus' answer, the way to get at the DOM is via the Document property.
itowlson
Is using the winforms container considered to be hackish?
caltech