3

I try Mobile Blazor Bindings, following this tutorial : https://learn.microsoft.com/fr-fr/mobile-blazor-bindings/walkthroughs/todo-app

I want to use HTML CSS and JS code to create a test app.

In razor page, try to inject @inject IJSInProcessRuntime jsRuntime but it make the app crash.

Is it possible to use Js Interop with Mobile Blazor Bindings ?

Erakx
  • 71
  • 1
  • 2
  • Just a suggestion if you want to use web standards to create a mobile app, then go with rock solid React Native. MBB is not production ready and it's all about do it in .NET – pouya Sep 10 '20 at 17:11

1 Answers1

1

Yes, it's possible. After some searching i find a way to do that. It's still in development, so it's all on your own risk. First, you need to download last version of master branch of MobileBlazorBindings (or clone repo to your local storage). Then you need to do some changes to source files. After that you need to compile these projects and pack them to nuget package. Link how to do that (skip first step). Then add these nuget packages and dll to your project from local storage. There some helpful link (If package version is not 0.5.41 you can just rename files with that version, work for me). And now you can use @inject IJSRuntime jsRuntime and JS.InvokeVoidAsync("function", params); in your razor component.

Find more there