Question

I have installed CefSharp.Wpf Version 31.0.0-pre1 using NuGet and installed the relevant dependencies (CefSharp.Common version 31.0.0-pre1, cef.redist version 3.1650.1562-pre3).

I have not managed to run the WebView yet as I cannot find PropertyChanged anymore in WebView. Is there some new way I have to use WebView to get hold of the PropertyChanged event as this is how it was started in CefSharp.Wpf version 1.25.7.

Was it helpful?

Solution

From an answer in this thread in the CefSharp google group:

Please use this app as your guide: https://github.com/cefsharp/CefSharp.MinimalExample It shows a very simple example of how CefSharp can be used. Some key points:

  • Deploy using NuGet. No other mechanism is supported with CefSharp3. (that doesn't mean that it won't work, it just means that you are on your own if you use some other approach. :) The NuGet package has some really clever stuff in it, which makes sure files gets copied when you run your app and so forth, so you really really don't want to disregards this advice.
  • Well... that was actually the only key point. ;)

But you're already using NuGet, so bonus points for that :-)

And here is the relevant part for you:

As for the Load() method, you don't need it any more (but the method just hasn't been deleted yet). Instead, you set the Address dependency property. Since it is a dependency property, you can data-bind to it (both to be able to get the currently loaded address, or to be able to update it to some other address of your liking).

In general, I've tried to work quite hard with CefSharp3 to make its WPF control behave more like a "normal WPF control" (using dependency properties etc) and not just as a Windows Forms-like hack. :) We're not quite there yet but we're moving steadily in that direction.

But yes, some form of nice "guide" for how all of this goodness could be used would be nice. It just isn't there yet, so for now, "use the source, Luke".

To sum it up: Yes, the PropertyChanged event "hack" as it was used in CefSharp.Wpf version 1.25.7. has been replaced with dependency properties etc.

Your current best place for information on how to use the new "CefSharp3" API is the MinimalExample linked to above and the CefSharp.Wpf.Example mentioned in the README.md on the CefSharp GitHub page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top