Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/bpawluk/rendermodedetector
- Owner: bpawluk
- License: apache-2.0
- Created: 2024-07-28T08:27:39.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-28T10:20:04.000Z (5 months ago)
- Last Synced: 2024-10-29T05:49:04.152Z (2 months ago)
- Topics: blazor, blazor-server, blazor-webassembly, detector, mode, render
- Language: C#
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
```