Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arivera12/BlazorCurrentDevice
Device detection for blazor using current-device.js
https://github.com/arivera12/BlazorCurrentDevice
blazor csharp
Last synced: about 2 months ago
JSON representation
Device detection for blazor using current-device.js
- Host: GitHub
- URL: https://github.com/arivera12/BlazorCurrentDevice
- Owner: arivera12
- License: mit
- Created: 2020-04-05T03:49:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-06-06T08:26:23.000Z (over 1 year ago)
- Last Synced: 2024-11-06T22:56:01.418Z (2 months ago)
- Topics: blazor, csharp
- Language: C#
- Homepage:
- Size: 1.02 MB
- Stars: 25
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-blazor - BlazorCurrentDevice - ![last commit](https://img.shields.io/github/last-commit/arivera12/BlazorCurrentDevice?style=flat-square&cacheSeconds=86400) Device detection for blazor using current-device.js. (Libraries & Extensions / 2D/3D Rendering engines)
README
# BlazorCurrentDevice
![](BlazorCurrentDeviceDemo.gif)
Device detection for blazor using current-device.js
## Installation
`Install-Package BlazorCurrentDevice -Version 1.0.7`
## Add reference in _Imports.razor
`@using BlazorCurrentDevice`
## Add the service in your services method
`services.AddBlazorCurrentDevice();`
## Add javascript library reference in your index.html
``## Usage
`
[Inject] IBlazorCurrentDeviceService BlazorCurrentDeviceService { get; set; }
`#### Device Methods
BlazorCurrentDeviceService
Method
Mobile
BlazorCurrentDeviceService.Mobile()
Tablet
BlazorCurrentDeviceService.Tablet()
Desktop
BlazorCurrentDeviceService.Desktop()
iOS
BlazorCurrentDeviceService.iOS()
iPad
BlazorCurrentDeviceService.iPad()
iPhone
BlazorCurrentDeviceService.iPhone()
iPod
BlazorCurrentDeviceService.iPod()
Android
BlazorCurrentDeviceService.Android()
Android Phone
BlazorCurrentDeviceService.AndroidPhone()
Android Tablet
BlazorCurrentDeviceService.AndroidTablet()
BlackBerry
BlazorCurrentDeviceService.Blackberry()
BlackBerry Phone
BlazorCurrentDeviceService.BlackberryPhone()
BlackBerry Tablet
BlazorCurrentDeviceService.BlackberryTablet()
Windows
BlazorCurrentDeviceService.Windows()
Windows Phone
BlazorCurrentDeviceService.WindowsPhone()
Windows Tablet
BlazorCurrentDeviceService.WindowsTablet()
Firefox OS
BlazorCurrentDeviceService.FireFoxOs()
Firefox OS Phone
BlazorCurrentDeviceService.FireFoxOsPhone()
Firefox OS Tablet
BlazorCurrentDeviceService.FireFoxOsTablet()
MacOs
BlazorCurrentDeviceService.MacOs()
MeeGo
BlazorCurrentDeviceService.MeeGo()
NodeWebkit
BlazorCurrentDeviceService.NodeWebkit()
Cordova
BlazorCurrentDeviceService.Cordova()
Television
BlazorCurrentDeviceService.Television()
#### Orientation Methods
Orientation
Method
Landscape
BlazorCurrentDeviceService.Landscape()
Portrait
BlazorCurrentDeviceService.Portrait()
### Useful Methods
Method
Returns
BlazorCurrentDeviceService.Type()
'mobile', 'tablet', 'desktop', or 'unknown'
BlazorCurrentDeviceService.Orientation()
'landscape', 'portrait', or 'unknown'
BlazorCurrentDeviceService.OS()
'ios', 'iphone', 'ipad', 'ipod', 'android', 'blackberry', 'windows', 'macos', 'fxos', 'meego', 'television', or 'unknown'
## TODO
- Implement onChangeOrientation callback## License
MIT