-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add support for configuring WebViewSettings via DI #5059
Conversation
8875efa
to
85c1ae7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Just some minor comments.
I believe I'll be able to leverage this to support DETAILED_ERRORS
via #4441!
src/BlazorWebView/src/SharedSource/BlazorWebViewServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
…ionExtensions.cs Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
8c1520f
to
2a8654b
Compare
return builder; | ||
} | ||
|
||
public static IServiceCollection ConfigureMauiHandlers(this IServiceCollection services, Action<IMauiHandlersCollection>? configureDelegate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PureWeen FYI we're adding an overload here for handler registration that goes off of IServiceCollection because in some Blazor scenarios that's all we have access to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I forgot to point it out.
@@ -9,14 +9,17 @@ public static MauiApp CreateMauiApp() | |||
{ | |||
var builder = MauiApp.CreateBuilder(); | |||
builder | |||
.RegisterBlazorMauiWebView() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I think overall this API is cleaner and easy to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks for handling all the feedback
Adds support for configuring the Development tools via a settings object registered in DI.
A few things to note:
Add<<Maui|Wpf|WindowsForms>BlazorWebView
that are the entry point on each flavor and perform all registrations necessary on the DI container.Settings
and notOptions
because Maui by default doesn't support the Options pattern.