title: How to use Javascript on a WPF WebBrowser Control via MVVM
body: <p>I am using an MVVM pattern on WPF4, though I am new to both. I am looking for a good solution to using a WebBrowser control that can receive Javascript commands and communicate with the ViewModel. It needs the following:</p>
  
  <ol>
  <li>Ability to collect values from Javascript forms, and return them to the ViewModel</li>
  <li>Use Javascript to determine ReadyState before</li>
  <li>Running Javascript commands (setting form values, use form values for logical steps, submit form) some which happen across multiple page loads</li>
  </ol>
  
  <p>The site being worked on is not under my control to edit or update. It makes heavy use of ActiveX and will not accept non-IE browsers (Awesomium will not work), so the standard WPF WebBrowser control is likely the only option.</p>
  
  <p><a href="https://stackoverflow.com/questions/263551/databind-the-source-property-of-the-webbrowser-in-wpf">This question</a> provides a solution to binding the source of a browser control with an attached property. I think this could be adapted to use the navigate method to send javascript, though I am not sure how values could be returned to the Viewmodel. This is the major hurdle I need to get over.</p>
  
  <p><strong>Heavy Edit</strong> - Question receiving very low views and no answers, completely reworded</p>