Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bpawluk/rendermodedetector

Detects current Render Mode in Blazor apps
https://github.com/bpawluk/rendermodedetector

blazor blazor-server blazor-webassembly detector mode render

Last synced: about 1 month ago
JSON representation

Detects current Render Mode in Blazor apps

Awesome Lists containing this project

README

        

# How to use
## Blazor Server project
### Install **BlazorUtils.RenderModeDetector.Server** NuGet package
```

```
### Register the detector
```
using BlazorUtils.RenderModeDetector.Server;

builder.Services.AddServerRenderModeDetector();
```

## Blazor WebAssembly project
### Install **BlazorUtils.RenderModeDetector.WebAssembly** NuGet package
```

```
### Register the detector
```
using BlazorUtils.RenderModeDetector.WebAssembly;

builder.Services.AddWebAssemblyRenderModeDetector();
```
## Usage
```
@using BlazorUtils.RenderModeDetector

@inject IRenderModeDetector RenderModeDetector

IsInteractive: @RenderModeDetector.IsInteractive


IsWebAssembly: @RenderModeDetector.IsWebAssembly


IsServer: @RenderModeDetector.IsServer


```