-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use webview2 control, fix background color of webview #182
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The async tasks 'GetBitmap' and 'GetMovieTrailer' methods have been refactored for readability and performance. The async/await semantics are now properly used instead of 'ContinueWith'. Moreover, an exception handling block has been added to 'GetMovieTrailer' method to log any errors during the movie trailer fetching process.
Optimized the process of choosing YouTube trailers from a collection in SearchResultViewModel. Replaced a sequential Any-First search pattern with more efficient FirstOrDefault. Additionally, updated Dispatcher.Invoke to Dispatcher.InvokeAsync in HtmlBox.xaml.cs to ensure the method is called asynchronously while keeping UI responsiveness.
This commit introduces the replacement of WebBrowser with WebView2 in the HtmlBox view of the FoliCon application. The WebView2 control provides more capabilities and better performance compared to the older WebBrowser control. Accordingly, the code is modified to use the functionality of WebView2, which includes the 'NavigateToString' method being called on the 'CoreWebView2' object instead of the outdated 'Browser' object. The 'InitializeAsync' method has also been added to ensure the WebView2 control is correctly initialized.
This commit primarily refactors HtmlBox's ProcessBrowse method to streamline its operations. A minor change to the _backgroundColor method is also included, adjusting color values for dark themes. The dependency property OnHtmlTextPropertyChanged has been tweaked to ensure proper access, and InitializeAsync has been updated to manage Browser settings and navigation.
A constant string value was revised for better readability in the conditional statement. The structure of the HTML code inside GenerateHtmlContent() method was also reorganized for cleaner representation. The 'IE=Edge' meta tag was removed as it's no longer necessary.
The project file FoliCon.csproj has been updated to include the Microsoft.Web.WebView2 package. This new addition, with version 1.0.2210.55, will be used for showing media videos instead of the old control.
The IsVideoAvailable property is now implemented with a getter method and simplified html generation logic by introducing an HtmlTemplate constant. Additionally, checks for video availability have been moved directly into the OnHtmlTextPropertyChanged event handler, leading to enhanced code maintainability and readability.
A new word, 'FoliCon', is added to the UserDictionary within the solution's DotSettings configuration. This addition helps with IDE spell-checking, as it will now recognize 'Foli' as a valid word and won't mark it as a spelling error.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.