Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView2Wpf init #86

Closed
jiongge opened this issue Mar 11, 2024 · 5 comments
Closed

WebView2Wpf init #86

jiongge opened this issue Mar 11, 2024 · 5 comments

Comments

@jiongge
Copy link

jiongge commented Mar 11, 2024

Thanks because this project solved my problem!
But the question is I want to know when the WebView2 initialization is done
Can set _WebBrowser into public or implement EnsureCoreWebView2Async method and CoreWebView2InitializationCompleted event

Thanks!~~

https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.wpf.webview2?view=webview2-dotnet-1.0.2365.46

@jiongge
Copy link
Author

jiongge commented Mar 11, 2024

image

@jiongge
Copy link
Author

jiongge commented Mar 11, 2024

Unloaded += (s, e) => Dispose(); I don't think that's necessary
Switching pages after I put WebView2Wpf into the Page caused problems

@ChrisPulman
Copy link
Member

Unloaded += (s, e) => Dispose(); I don't think that's necessary Switching pages after I put WebView2Wpf into the Page caused problems

This is to release the Web View and allow exit of the App, I will add a property to allow you to change this as a setting, AutoDispose it is defaulted to true so as not to break existing functionality.

@ChrisPulman
Copy link
Member

@jiongge Please check the latest version, hopefully it contains all you need as per your request. You may need to set the AutoDispose property to false to fit your needs. You will then need to Dispose the control to release resources allowing your App to shutdown, toggling this property True to False will remove the Dispose handler on Unloaded, toggling this property False to True will add the Dispose handler on Unloaded.
If there is anything missing, please let me know and I will do my best to add any additions.

@jiongge jiongge closed this as completed Mar 12, 2024
@jiongge
Copy link
Author

jiongge commented Mar 12, 2024

it's perfect for me. Thank you!~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants