[Blazor] Call .NET from JS - OperatingSystem.IsBrowser() (#33846)
parent
f679e7eb6a
commit
0965570d73
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue