4

So I've been trying to use something other than IE for my webcontrol in a side-project of mine (C#, WPF project type) and I was looking around for alternatives and have tried in the past but failed to implement them.

I decided to try again and implement awesomium, however it is still confusing as always and doesn't have any straight forward examples for me to use as a base.

Would someone be able to show me how to implement awesomium for a webview/webcontrol? My vision is to have it navigate to a shoutbox website, and while my application is still open to keep it there (i.e not refresh it so that it doesn't lose anything) as it is being shown in the space of tabitem.

Dagrooms
  • 1,507
  • 2
  • 16
  • 42
Darkshadow
  • 103
  • 1
  • 9
  • http://wiki.awesomium.net/wpf/webcontrol.html have good examples of how to add Awesomium WebControl to your WPF app and navigate to a specific page. Regarding tab item, there should not be any problem, the WebControl will not refresh until you say it to do so. – Aleksey Shubin Apr 26 '15 at 02:44

2 Answers2

2

I have used Awesomium, but the last version I used was 1.6.1, and there are some differences between that and the current version - they've actually made things easier.

The documentation says that you should be able to force navigation of the control simply by setting the Source property:

<osm:WebControl Name="webControl"
                Source="http://www.google.com/" 
                />

If you find the Source property is not bindable then simply revert to using some code behind in the view - subscribe to a property change event from the viewmodel (or from an event broker if you are using one), and change the Source property in response to an event.

slugster
  • 49,403
  • 14
  • 95
  • 145
1

I believe, the problem with the Source property is that if you are setting it to the same URI to refresh, it won't refresh because of a bug. It is documented on their github page and their answers page.

As workaround, to refresh your page correctly you need to pass a fake URI first and then your page again to your binding property, like this:

CurrentSource = "FakeUriString".ToUri();
CurrentSource = "http://www.yourpage.com".ToUri();

Keep in mind, my current version of Awesomium is 1.7.4.2 and they may fix this issue in the future as they stated in their issues page.

Murat Aykanat
  • 1,648
  • 4
  • 29
  • 38