WPF Webbrowser cannot display Angular - wpf

I am trying to embed an Angular web app in WPF.
I have followed the steps here to create a very basic angular application.
Then I created a brand new WPF application, added a WebBrowser control and set its Source property equal to the URL of the angular application.
I found the following post but it did not help.
I get the following error when the WPF application starts.
"Unable to get property 'apply' of undefined or null reference"
in the vendor.bundle.js

The default WebBrowser object that .Net applications are using it is IE7 I guess..
I've found a good answer here for making WebBrowser to use IE10 or IE11 (Edge).
Another solution is to use third-party WebBrowsers, this is an old article but I think it might help.

After trial and error the meta tag fixed it. Originally I was putting outside the head tag. Adding it to head tag fixed it.

Related

Cefsharp Chrominumwebbrowser not working in WPF

Hi I am new to cefsharp and tried using Cefsharp chromium web browser .
when ever i tried to call the webbrowser it throws an exception like below
Could not load file or assembly 'CefSharp.Wpf, PublicKeyToken=40c4b6fc221f4138' or one of its dependencies. The system cannot find the file specified.'
But i have added the reference cefsharp.wpf in project
What do i miss here ?
And if i tried from codebehinf too the same issue occurs.
I just had the below piece of code next to InnitializeComponent.
ChromiumWebBrowser browser = new ChromiumWebBrowser();
Manually i counldn't resolve the issue in my working solution.
As a work around what i did is as #amaitland suggested i cloned a copy of CefSharp Minimal Example from here and used the Minimal Example for WPF solution.
I just copied all the logic from my solution tand pasted it in the minimal expansion and updated it .
Now ChromiumWebBrowser works fine for me ( Only after using that Minimal example provided by cefsharp )..
In Application > Properties > Build
Change Check "Prefer 32-bits"

WPF WebBrowser : get Navigation error

I have a WPF application with a WebBrowser control inside.
When I navigate to a website, I would like to know if the page is online or not. I the page is not accessible, I would like to navigate to a local html error page...
How can I do it ?
The first solution I found is to do a WebRequest before navigating, but it require a additional website call... I would like to find an other solution.
I wanted to get the HTTP Status code of the page in the "navigated" event of the WebBrowser, but I found here that it's not possible qith a WebBrowser control because the WebResponse is always null...
Is there an other solution?
This seems a common question, I added a solution here using the .Net NavigationService. Alternatives are also discussed.

Can't get Dynamic Data Display working with WPF Browser Application

Can I get Dynamic Data Display library working with WPF Browser App? I'm getting "Target Invocation Exception" when attempting to launch the app, regular desktop WPF app runs just fine.
Update 1: "That assembly does not allow partially trusted callers." is the error, got it by adding D3's chart plotter dynamically. Looking into it now.
Fixed by switching to "This is a full trust application" option in the Security tab of my project's properties. May not be appropriate for everyone, check for the potential implications of it. Did the trick for me though.

Silverlight with Extjs

I haven't worked with extJS and Silverlight. Considering a requirement that I have to look into - is there a way to host Silverlight applications in extJS.
I checked out the Sencha forums, but did not find any direction.
Hope any one of you might have dealt with this issue earlier ?
Regards
Ext-JS is a JavaScript framework that allows you to create HTML pages dynamically. Silverlight is a plugin that embeds interactive content, packaged as a XAP, within an HTML document. This embedding is achieved via the HTML object tag.
You can certainly use Ext-JS to dynamically add object tags to pages and dynamically load XAP files. So I would say the answer is, yes, you can host Silverlight content using ExtJS.

Is there a "Browser Control" to host a website inside Flash/Silverlight?

I'm looking for something similar to the VB6 / .Net Winforms "Browser Control", that let's you show a browser inside your application.
I don't want to just render a page, I want it to be a fully-functional browser, in which people can click links, will run Javascript, etc.
In essence, what I want is an IFrame, only that it runs inside a Flash app, or a Silverlight app.
The ultimate reason for this is that I want to defeat IFrame busters. I'm making a web app that lets you see other sites inside of it, and I'm running into a bunch of sites that have this code:
var t=top.location,w=window.location;if(t!=w) t.replace(w);
(that's from eBay BTW)
which essentially pops the user out of my site and into theirs.
My hope is that by using a "browser control" of some sort, inside a plugin sandbox, "top", will be top for that browser control, and not for my site.
Of course, if you have any other ideas to achieve the same, they'll be more than welcome.
Edit: I've tried the Component One control suggested by Bill, but it didn't work for these purposes, because it's creating an IFrame outside of the SilverLight control, so it executes in the same context as the page hosting Silverlight, which is what I'm trying to avoid.
Northcode SWF Studio allows you to add browser window on the stage in Flash. I personally use SWF Studio as a third party SWF2EXE tool to extend the power of Flash projectors. It's quite stable and powerful. As far as browser control is concerned here is the example you can download and test if it serves your purpose. Check the Browser APT here.
We've not built a component to enable folks to do this but we're open to suggestions here. That being said, easiest solution is an iFrame, but word of caution in that when you overlay an iFrame over the the top of Silverlight we've seen customers experience perf issues as a result (mostly due to alpha transparency of the iframe etc).
This isn't isolated to Silverlight, Flash suffers the same issue as it has to do with browsers and rendering within the given operating system.
HTH.
Scott Barnes / Rich Platforms Product Manager / Microsoft.
I use the HTML control created by Component One. It has the limitation that the Silverlight object in the page should be set to windowless, but otherwise it works very well.
It's an old post but I'll add my tupence answer. I used the DivElements free control for Silverlight link text and it works quite nicely. It just positions the div accurately so that it looks like it's on top.
As for the other such controls, you've got to set the windowless property of the Silverlight container to true.
It works really well for me and I'm able to seemlessly have Google maps and the Acrobat plugin displayed side by side with my Silverlight application.
PS: because the component just adds a <div> to the page, you can't do stuff like having it load dynamically Javascript file like in the <header> tag.
PPS: when setting the HTML code "by hand", be sure to hook up on the DocumentReady or Loaded event before playing with the HTML DOM.
Hope that helps someone.

Resources