Closed gleIsocom closed 3 months ago
Have you tried passing jsRuntime as a parameter to the dialog?
First you inject jsRuntime:
[Inject] public IJSRuntime? js {get; set;}
Then use it in the DialogOptionsEx class:
DialogOptionsEx options = new DialogOptionsEx() { JsRuntime = js};
var dialog = await DialogService.ShowEx<SampleType>("DocTitle", parameters, options);
Edit: Maybe also naming the injected JsRuntime same as the Options-Variable is a problem?
For an web assembly app you can still inject the IJSRuntime in your MainLayout for example and call
jsRuntime.InitializeMudBlazorExtensionsAsync()
Contact Details
No response
What happened?
I have created a Blazor WebAssembly testapp under net7, integrated MudBlazor and added MudBlazor.Extensions and want to display a sample dialog. No matter what I try, I always get the same error.
Expected Behavior
No Exceptions
Screenshots
Reproduction link
No response
What application type are you referring to?
WebAssembly
Custom Application Type
No response
MudBlazor.Extension Version
1.7.89
MudBlazor Version
6.20.0
What .net Version are you using?
.Net7
What browser are you using?
Chrome, Edge
Sample Solution
BlazorApp22.zip
Pull Request
No response
Code of Conduct