I am using CefSharp for WPF. I want to use it in MVVM architecture. Unfortunately there is a problem. In the view I have:
<ContentPresenter Content="{Binding Browser}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
In ViewModel I put a new object into Browser:
var settings = new CefSharp.Settings
{
PackLoadingDisabled = true,
}
if (CefSharp.CEF.Initialize(settings))
{
int counter = 0;
this.Browser = new WebView();
}
Unfortunately I cannot Load any URL at any point after that. It says Browser not initialized and actually the IsBrowserInitialized property (in Browser) is false.
That is weird because in test app, not MVVM, where I used same code to instantiate the WebView it works. Only difference is that I programmatically added the Browser to a Grid as it was not MVVM.
Anyone got the CefSharp in WPF MVVM app? Any ideas?
Thanks
EDIT:
I have noticed in test non-MVVM app, that the IsBrowserInitialized property is set to false until window constructor ends the job.