The demo has the WebView2 hosted within a <winui:TabView> object. @William_Yu Is there a way to get just the bare browser view, with no containing tab panel?
This has been a great start. I’m finding that when the user clicks in the WebView it takes focus away from the window in such a way that it affects the Title Bar (the Window seems to be in the background now).
Any ideas how to prevent or fix this?
I tried cheating and adding a self.SetFocus timer in the EventTriggered event when eventName = "FocusReceived" but that did not appear to work.
I was hoping to make a DesktopContainer that abstracted the HTMLViewer functions into the correct control per platform. I will post the source after I eat lunch. Can you help me understand how to access the new properties William added to the XAML Control window?
Maybe I’m misunderstanding how to use something? Importantly, the goal is self-contained, so I cannot make use of a subclass that would need to accompany the DesktopContainer.
Seems like IDE typeahead doesn’t work for properties, however it does compile:
XAMLContainer1
Sub Opening() Handles Opening
me.userAgent = "foobar"
Me.Invoke("WebViewAlpha.Navigate", "https://dnschecker.org/user-agent-info.php")
End Sub
The only thing stopping me from using this now is the weird focus-consuming issue. @William_Yu is that something I should file a ticket for, or is there something I’m misunderstanding again?
If you click inside the web view, it takes focus away from the window in such a way that it affects the title bar. The github repository is up to date if you need an example project.
I’m really not a fan of this “reduced cross platform” stuff. Why is WebView2 not simply an option in HTMLViewer? Or even the only renderer. Xojo doesn’t need to be building CEF anymore, and we don’t need its bloat, yet to “solve” that we need to do this awful song and dance that Xojo should be doing for us.
In my app I’ve written a container that wraps both HTMLViewer and WebView2MBS, and switches based on the platform. But it’s high time Xojo kicks CEF to the curb and does this for me.
I had to use XAML webview2 to get some websites working properly (It might just be a user agent thing, but the webview2 fixed everything).
However if you make a webview, and move yours to another screen, does it when you right click, put the popup menu on the correct screen/placement? Mine always only shows up in the first place the webview was shown.