[Blazor] Call .NET from JS - OperatingSystem.IsBrowser() (#33846)

pull/33848/head
Robert Haken 2024-10-14 16:20:39 +02:00 committed by GitHub
parent f679e7eb6a
commit 0965570d73
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 6 deletions

View File

@ -786,7 +786,6 @@ In the following `GenericsExample` component:
```razor
@page "/generics-example"
@using System.Runtime.InteropServices
@implements IDisposable
@inject IJSRuntime JS
@ -813,8 +812,7 @@ In the following `GenericsExample` component:
public async Task InvokeInterop()
{
var syncInterop =
RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"));
var syncInterop = OperatingSystem.IsBrowser();
await JS.InvokeVoidAsync(
"invokeMethodsAsync", syncInterop, objRef1, objRef2);
@ -834,7 +832,6 @@ In the following `GenericsExample` component:
```razor
@page "/generics-example"
@using System.Runtime.InteropServices
@implements IDisposable
@inject IJSRuntime JS
@ -861,8 +858,7 @@ In the following `GenericsExample` component:
public async Task InvokeInterop()
{
var syncInterop =
RuntimeInformation.IsOSPlatform(OSPlatform.Create("BROWSER"));
var syncInterop = OperatingSystem.IsBrowser();
await JS.InvokeVoidAsync(
"invokeMethodsAsync", syncInterop, objRef1, objRef2);