From 75b4d130c736e03417182acb32aa42b654bf7d2e Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 2 Apr 2014 17:56:19 +0100 Subject: [PATCH] Should never rely on webBrowser; it's the backing field for the WebBrowser property (which should be used instead of going straight to the backing field...). --- CefSharp.Wpf.Example/Views/Main/MainViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs index aecf0b65a..2e9a524bc 100644 --- a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs +++ b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs @@ -125,7 +125,7 @@ namespace CefSharp.Wpf.Example.Views.Main // TODO: This is a bit of a hack. It would be nicer/cleaner to give the webBrowser focus in the Go() // TODO: method, but it seems like "something" gets messed up (= doesn't work correctly) if we give it // TODO: focus "too early" in the loading process... - WebBrowser.LoadCompleted += delegate { Application.Current.Dispatcher.BeginInvoke((Action)(() => webBrowser.Focus())); }; + WebBrowser.LoadCompleted += delegate { Application.Current.Dispatcher.BeginInvoke((Action)(() => WebBrowser.Focus())); }; } break;