Can I embeded IE in my wpf application and interact with it firing events - wpf

Can I embeded IE in my wpf application and interact with it firing events?
e.g. can I fill a form and press submit button programmatically?

Below is the link to the web browser control for WPF, this control was not part of the initial release of WPF, and was added in 3.5 SP1. As long as you are targeting 3.5 SP1 you can use this control and interact with the content in it. I have a WPF application that does use this control and we do a lot of JavaScript interactivity with the content from the browser by drawing on a WPF canvas and sending that information to the content API of the web browser control.
If you need an example I can look up some code samples from the application and send them your way.

Related

WebBrowser in C# winforms lagging

I'm currently building a desktop app using C# winforms. One of the requirement is to display the client's website on a form, so I've just added a webbrowser widget.
This webpage seems to "lag" a lot, all CSS or JQuery animations seems jaggy. I tried to open the page in IE and it doesn't lag that much.
Is there any option I need to pass to the webbrowser widget to make it more faithfull ? Some double buffering, or any other kind of parameters that I could use ?

Hosting Silverlight Control

In my WPF application I am using a Web Browser control, which is showing a Silverlight application. I have to go with this design(Web Browser and Silverlight) because, I badly need PivotViewer control, which only available on Silverlight.
Now, I need to communicate from WPF to silverlight app which was in Web Browser control (i.e. Pass an .NET List/Class).
How can I do it? and What are my options?
If your application is built around a Silverlight control, why are you hosting it in WPF? Wouldn't it be simpler to just have a Silverlight Desktop Application?

How to get selected row of ListView in web browser control in WPF

I have a web site has a ListView and navigate it by using web browser control in WPF. I want to get selected item of ListView from web browser control. I can get selected text in web browser control by using Microsoft HTML Object Library but can't do this. Is there any way to do this?
Thank you.
You can interop with the web browser control from WPF using the DLR features.

Silverlight App inside WPF WebBrowser?

I have a hopefully trivial question. Currently, my company works with a rather obscure language (SyngergyDE) and we need to call a SilverLight application inside our product. Unfortunately, this obscure 3rd party language only (currently) supports the opening of WPF screens. So with that said, I thought I'd develop a small WPF user control that contains a "WebBrowser" control and navigate to the silverlight application's URI. This works fine, and I'm able to see the SL application. Here is my question - we have a "Close" button on the SL application, and when users "Click" that button, we want the window to close.
Does anyone have any suggestions on how we can communicate the "Closing of the SL App" to the WPF user control, so that the entire WPF user control closes as well?
Thanks everyone,
-Tom
Attach an event handler to the WebBrowser.Navigated event.
Have the close button in the Silverlight application use:-
HtmlPage.Window.Navigate(new Uri("about:blank", UriKind.Absolute));
When the Navigated event fires in WPF with the url "about:blank" then its time to close the control.
Use Javascript and the HTML DOM as the glue here.
For example, when the SL app close button is clicked, have Silverlight trigger some Javascript code that sets a flag, or alternately, raises some HTML document event.
The WPF control could poll that flag in the HTML + Javascript, or alternately listen for that HTML document event, then close the user control.

How to embed IE (created using Watin) inside a WPF application [duplicate]

Can I embeded IE in my wpf application and interact with it firing events?
e.g. can I fill a form and press submit button programmatically?
Below is the link to the web browser control for WPF, this control was not part of the initial release of WPF, and was added in 3.5 SP1. As long as you are targeting 3.5 SP1 you can use this control and interact with the content in it. I have a WPF application that does use this control and we do a lot of JavaScript interactivity with the content from the browser by drawing on a WPF canvas and sending that information to the content API of the web browser control.
If you need an example I can look up some code samples from the application and send them your way.

Resources