Skip to content

Commit 891e5c5

Browse files
committed
WPF Example - Readd Legacy Binding
if CefSharpSettings.LegacyJavascriptBindingEnabled then register bound and boundAsync objects
1 parent d2a00e5 commit 891e5c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ public BrowserTabView()
4141
//the browser is initialized.
4242
CefSharpSettings.WcfEnabled = true;
4343

44+
if (CefSharpSettings.LegacyJavascriptBindingEnabled)
45+
{
46+
browser.JavascriptObjectRepository.Register("bound", new BoundObject(), isAsync: false, options: BindingOptions.DefaultBinder);
47+
browser.JavascriptObjectRepository.Register("boundAsync", new AsyncBoundObject(), isAsync: true, options: bindingOptions);
48+
}
49+
4450
//If you call CefSharp.BindObjectAsync in javascript and pass in the name of an object which is not yet
4551
//bound, then ResolveObject will be called, you can then register it
4652
browser.JavascriptObjectRepository.ResolveObject += (sender, e) =>

0 commit comments

Comments
 (0)