I have a Webview2, that loads this page https://quillbot.com/grammar-check and a ViewModel, that has text.
What I want to do, is to put my text into the grammar editor
and execute everything in the VM, but because the webview is not MVVM friendly, I had to use code behind
I already tried this
`public SpellCheckWindow()
{
InitializeComponent();
ConfigureSite();
}
private async void ConfigureSite()
{
await web.EnsureCoreWebView2Async();
web.Source = new Uri("https://quillbot.com/grammar-check");
web.NavigationCompleted += Web_NavigationCompleted;
}
private async void Web_NavigationCompleted(object? sender, CoreWebView2NavigationCompletedEventArgs e)
{
var msg = "Hello from a newly loaded .NET window.";
var elem = await web.ExecuteScriptAsync($"document.getElementById('GRAMMAR_EDITOR').innerHTML");
}
`
but it doesn't work
I have a Webview2, that loads this page https://quillbot.com/grammar-check and a ViewModel, that has text.
What I want to do, is to put my text into the grammar editor
and execute everything in the VM, but because the webview is not MVVM friendly, I had to use code behind
I already tried this
`public SpellCheckWindow()
{
InitializeComponent();
ConfigureSite();
}
`
but it doesn't work