Closed msc-bsw closed 10 years ago
Looking at the code the Dispatcher.CheckAccess()
check isn't require anymore as it's always executed on the UI Thread.
If you remove that block from https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/DelegateCommand.cs#L38 does it solve your problem?
Yes, it does. But I don't know what side effects are coming with this removal.
Application.Current.Dispatcher.BeginInvoke((Action) RaiseCanExecuteChanged);
RaiseCanExecuteChanged
is only referenced three times, and that call is wrapped up by a method RaiseCommandsCanExecuteChanged
which it's self is called here https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf/ChromiumWebBrowser.cs#L664 which you'll see is executed on the UI Thread.
So it's safe to remove :smile: The WPF version has had some progressive cleanup over the last few months, so there are still a few more improvements to make, as is always the case!
Ok, thanks ;-)
Hey,
i implemented the WPF chromium web browser in my document viewer project, that is also WPF. This document viewer is embedded in a WinForms project, which is pretty big right now.
The WPF chromium web browser doesn't work in a WinForms project because "System.Application.Current" is null and therefore an exception comes up in RaiseCanExecuteChanged in CefSharp.Wpf.DelegateCommand.cs on line 38.
I know I could embed the CefSharp.WinForms WebBrowser to my WPF project but is it possible to make this work for my project setup?
Regards
msc