{"id":15092961,"url":"https://github.com/aathifmahir/mauiblazorbridge","last_synced_at":"2026-01-04T16:54:19.272Z","repository":{"id":246032984,"uuid":"815704272","full_name":"AathifMahir/MauiBlazorBridge","owner":"AathifMahir","description":"MauiBlazorBridge is Helper Utitlity That Makes Easier for Maui Blazor Hybrid Developers to Seamlessly Detect Which Platform Their Currenly Running On, Form Factor and etc..","archived":false,"fork":false,"pushed_at":"2024-07-23T10:04:26.000Z","size":298,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T14:11:23.536Z","etag":null,"topics":["blazor","blazor-hybrid","formfactor","maui","maui-bla","maui-blazor-hybrid","platform"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AathifMahir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"AathifMahir","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2024-06-15T22:24:30.000Z","updated_at":"2024-07-23T10:03:58.000Z","dependencies_parsed_at":"2024-07-23T11:54:54.117Z","dependency_job_id":"6d49894e-9ac0-4a17-980d-cdcc36f8c85d","html_url":"https://github.com/AathifMahir/MauiBlazorBridge","commit_stats":{"total_commits":70,"total_committers":1,"mean_commits":70.0,"dds":0.0,"last_synced_commit":"e8cffcf4e84fe3dbd6e97aedfb6456d45437e591"},"previous_names":["aathifmahir/mauiblazorbridge"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AathifMahir%2FMauiBlazorBridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AathifMahir%2FMauiBlazorBridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AathifMahir%2FMauiBlazorBridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AathifMahir%2FMauiBlazorBridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AathifMahir","download_url":"https://codeload.github.com/AathifMahir/MauiBlazorBridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244952554,"owners_count":20537467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazor","blazor-hybrid","formfactor","maui","maui-bla","maui-blazor-hybrid","platform"],"created_at":"2024-09-25T11:02:06.370Z","updated_at":"2026-01-04T16:54:19.220Z","avatar_url":"https://github.com/AathifMahir.png","language":"C#","funding_links":["https://github.com/sponsors/AathifMahir"],"categories":[],"sub_categories":[],"readme":"# MauiBlazorBridge\n\nMauiBlazorBridge is a Helper Utitlity That Makes Easier for Maui Blazor Hybrid Developers to Seamlessly Detect Platform, FormFactor and Etc..\n\n|**Latest Stable** | **Latest Preview**|\n|  :---:     |    :---:   |\n|[![AathifMahir.Maui.MauiShakeDetector](https://img.shields.io/nuget/v/AathifMahir.MauiBlazor.MauiBlazorBridge)](https://www.nuget.org/packages/AathifMahir.MauiBlazor.MauiBlazorBridge/) | [![AathifMahir.Maui.MauiShakeDetector](https://img.shields.io/nuget/vpre/AathifMahir.MauiBlazor.MauiBlazorBridge)](https://nuget.org/packages/AathifMahir.MauiBlazor.MauiBlazorBridge/absoluteLatest) |\n\n# Get Started\n\n**1.** In order to use the **MauiBlazorHybrid** you need to call the extension method in your **Program.cs** file as follows: \n\n```csharp\nbuilder.Services.AddMauiBlazorBridge();\n```\n\n**2.** In the `_imports.razor` file, you need to import the namespace as follows:\n\n```razor\n@using MauiBlazorBridge\n```\n\n**3.** In `MainLayout.razor` file, you need to add `BridgeProvider` to Initialize the Bridge. Additionally Setting `ListenerType` Property to `Global` Makes Bridge to Listen to FormFactor Changes Globaly Instead of Creating and Disposing Listener During the Usage of `BridgeFormFactor` Component, Additionally If it is Set to `Suppressed` that would prevent Bridge from Creating a Listener Instead Get Values Once from the Device and Use Across the Bridge\n\n```html\n@inherits LayoutComponentBase\n\u003cdiv class=\"page\"\u003e\n    \u003cdiv class=\"sidebar\"\u003e\n        \u003cNavMenu /\u003e\n    \u003c/div\u003e\n\n    \u003cmain\u003e\n        \u003carticle class=\"content px-4\"\u003e\n            @Body\n        \u003c/article\u003e\n        \u003c!-- Add BridgeProvider --\u003e\n        \u003cBridgeProvider/\u003e\n    \u003c/main\u003e\n\u003c/div\u003e\n```\n\n**Disclaimer:** When it comes PreRendering Enabled Blazor Flavor, You don't need to add `BridgeProvider` in `MainLayout.razor` file, Instead you need to add `BridgeProvider` in all the different Blazor Components that Utilizes Bridge. Additionally you need to Enable Interactivity for that Specific Component or Page, Check the [Example Here](https://github.com/AathifMahir/MauiBlazorBridge/blob/master/sample/MauiBlazorBridge.Blazor.Server.Sample/Components/Pages/BridgePage.razor)\n\n# Usage\n\n```html\n@inject IBridge Bridge\n\n\u003cBridgeFormFactor\u003e\n    \u003cMobile\u003e\n        \u003ch3\u003eFormFactor : Mobile\u003c/h3\u003e\n    \u003c/Mobile\u003e\n    \u003cTablet\u003e\n        \u003ch3\u003eFormFactor : Tablet\u003c/h3\u003e\n    \u003c/Tablet\u003e\n    \u003cDesktop\u003e\n        \u003ch3\u003eFormFactor : Desktop\u003c/h3\u003e\n    \u003c/Desktop\u003e\n    \u003cDefault\u003e\n        \u003ch3\u003eFormFactor : Unknown\u003c/h3\u003e\n    \u003c/Default\u003e\n\u003c/BridgeFormFactor\u003e\n\n\u003ch3\u003ePlatform : @Bridge.Platform\u003c/h3\u003e\n\u003ch3\u003ePlatform Version : @Bridge.PlatformVersion\u003c/h3\u003e\n\u003ch3\u003eFrameWork : @Bridge.Framework\u003c/h3\u003e\n```\n\n# Components\n\n## BridgeFormFactor\n\n```html\n\u003cBridgeFormFactor\u003e\n    \u003cMobile\u003e\n        \u003ch3\u003eFormFactor : Mobile\u003c/h3\u003e\n    \u003c/Mobile\u003e\n    \u003cTablet\u003e\n        \u003ch3\u003eFormFactor : Tablet\u003c/h3\u003e\n    \u003c/Tablet\u003e\n    \u003cDesktop\u003e\n        \u003ch3\u003eFormFactor : Desktop\u003c/h3\u003e\n    \u003c/Desktop\u003e\n    \u003cDefault\u003e\n        \u003ch3\u003eFormFactor : Unknown\u003c/h3\u003e\n    \u003c/Default\u003e\n\u003c/BridgeFormFactor\u003e\n```\n\n**Recommended Approach:** To obtain the current Form Factor, bind to the `FormFactorChanged` EventCallBack in the BridgeFormFactor component as Shown in the below example\n\n```html\n\n\u003cBridgeFormFactor @bind:FormFactorChanged=\"FormFactorChanged\"\u003e\n    \u003cMobile\u003e\n        \u003ch3\u003eFormFactor : Mobile\u003c/h3\u003e\n    \u003c/Mobile\u003e\n    \u003cTablet\u003e\n        \u003ch3\u003eFormFactor : Tablet\u003c/h3\u003e\n    \u003c/Tablet\u003e\n    \u003cDesktop\u003e\n        \u003ch3\u003eFormFactor : Desktop\u003c/h3\u003e\n    \u003c/Desktop\u003e\n    \u003cDefault\u003e\n        \u003ch3\u003eFormFactor : Unknown\u003c/h3\u003e\n    \u003c/Default\u003e\n\u003c/BridgeFormFactor\u003e\n\n@code {\n\tprivate DeviceFormFactor FormFactorChanged { get; set; }\n}\n\n```\n\n\n## BridgePlatform\n\n```html\n\u003cBridgePlatform\u003e\n\t\u003cAndroid\u003e\n\t\t\u003ch3\u003ePlatform : Android\u003c/h3\u003e\n\t\u003c/Android\u003e\n\t\u003cIOS\u003e\n\t\t\u003ch3\u003ePlatform : iOS\u003c/h3\u003e\n\t\u003c/IOS\u003e\n\t\u003cWindows\u003e\n\t\t\u003ch3\u003ePlatform : Windows\u003c/h3\u003e\n\t\u003c/Windows\u003e\n\t\u003cMac\u003e\n\t\t\u003ch3\u003ePlatform : MacCatalyst\u003c/h3\u003e\n\t\u003c/Mac\u003e\n\t\u003cDefault\u003e\n\t\t\u003ch3\u003ePlatform : Unknown\u003c/h3\u003e\n\t\u003c/Default\u003e\n\u003c/BridgePlatform\u003e\n ```\n\n ## BridgeFramework\n\n ```html\n \u003cBridgeFramework\u003e\n   \u003cMaui\u003e\n    \u003ch3\u003eFramework : Maui\u003c/h3\u003e\n   \u003c/Maui\u003e\n   \u003cBlazor\u003e\n   \u003ch3\u003eFramework : Blazor\u003c/h3\u003e\n   \u003c/Blazor\u003e\n \u003c/BridgeFramework\u003e\n ```\n\n # Note\n\n The Documentation is Under Construction, More Features and Components will be Added Soon.\n\n # License\n\n MauiBlazorBridge is licensed under the **MIT** license\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faathifmahir%2Fmauiblazorbridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faathifmahir%2Fmauiblazorbridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faathifmahir%2Fmauiblazorbridge/lists"}