{"id":15060022,"url":"https://github.com/egvijayanand/dotnet-maui-toolkit","last_synced_at":"2025-04-10T05:45:52.092Z","repository":{"id":37016736,"uuid":"453914382","full_name":"egvijayanand/dotnet-maui-toolkit","owner":"egvijayanand","description":".NET MAUI Toolkit is a set of fluent helper methods and classes to simplify working with .NET MAUI. Made available as NuGet packages.","archived":false,"fork":false,"pushed_at":"2025-01-20T09:56:56.000Z","size":306,"stargazers_count":20,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T06:54:45.194Z","etag":null,"topics":["android","blazor","blazor-hybrid","dotnet","dotnet-maui","dotnet-maui-blazor","dotnetmaui","hybrid","hybrid-app","hybrid-apps","ios","mac-catalyst","macos","maui","maui-blazor","razor","shared-library","windows","winui","winui3"],"latest_commit_sha":null,"homepage":"https://egvijayanand.in/","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/egvijayanand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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":["egvijayanand"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://paypal.me/egvijayanand","https://www.buymeacoffee.com/egvijayanand"]}},"created_at":"2022-01-31T07:26:26.000Z","updated_at":"2025-03-23T15:47:10.000Z","dependencies_parsed_at":"2023-11-26T11:21:48.463Z","dependency_job_id":"2eeaab8f-0318-49fb-bec5-782cd33c4cd2","html_url":"https://github.com/egvijayanand/dotnet-maui-toolkit","commit_stats":null,"previous_names":[],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egvijayanand%2Fdotnet-maui-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egvijayanand%2Fdotnet-maui-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egvijayanand%2Fdotnet-maui-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egvijayanand%2Fdotnet-maui-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egvijayanand","download_url":"https://codeload.github.com/egvijayanand/dotnet-maui-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166881,"owners_count":21058479,"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":["android","blazor","blazor-hybrid","dotnet","dotnet-maui","dotnet-maui-blazor","dotnetmaui","hybrid","hybrid-app","hybrid-apps","ios","mac-catalyst","macos","maui","maui-blazor","razor","shared-library","windows","winui","winui3"],"created_at":"2024-09-24T22:51:17.946Z","updated_at":"2025-04-10T05:45:52.060Z","avatar_url":"https://github.com/egvijayanand.png","language":"C#","funding_links":["https://github.com/sponsors/egvijayanand","https://paypal.me/egvijayanand","https://www.buymeacoffee.com/egvijayanand"],"categories":[],"sub_categories":[],"readme":"Join me on [**Developer Thoughts**](https://egvijayanand.in/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=toolkit), an exclusive blog for .NET MAUI and Blazor, for articles on working with these toolkits and much more.\n\n### VijayAnand.Toolkit.Markup\n\n[VijayAnand.Toolkit.Markup](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/) is a `shared class library NuGet package` with a set of fluent helper methods and classes for Xamarin.Forms / .NET MAUI to facilitate rapid UI development and better reuse in C#.\n\n\u003c!-- [![VijayAnand.Toolkit.Markup - NuGet Package](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/) --\u003e\n\n|Channel|.NET 8|.NET 9|\n|:---:|:---:|:---:|\n|Stable|[![.NET 8](https://badgen.net/badge/nuget/v3.6.0/blue?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/3.6.0)|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/)|\n\u003c!--|Preview|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/pre?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/absoluteLatest)|--\u003e\n\n\u003c!--|[VijayAnand.Toolkit.Markup](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/)|.NET 6|.NET 7|.NET 8|.NET 9|\n|:---:|:---:|:---:|:---:|:---:|\n|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.2.0/blue?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/1.2.0)|[![.NET 7](https://badgen.net/badge/nuget/v2.2.0/blue?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/2.2.0)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/)|-|\n|Preview|-|-|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.Toolkit.Markup/pre?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.Toolkit.Markup/absoluteLatest)|--\u003e\n\nThis extends the features of the official C# Markup NuGet package from Microsoft.\n\n`netstandard2.0` library targets Xamarin.Forms 5 and is dependent on the [Xamarin.CommunityToolkit.Markup](https://www.nuget.org/packages/Xamarin.CommunityToolkit.Markup/) package.\n\nWhereas the `net8.0` and `net9.0` library targets .NET MAUI and is dependent on the [CommunityToolkit.Maui.Markup](https://www.nuget.org/packages/CommunityToolkit.Maui.Markup/) package. *Note this is NOT a MauiCompat package.*\n\n### VijayAnand.MauiToolkit.Core\n\nThis is a toolkit with a set of abstractions to simplify working with .NET MAUI and Blazor.\n\n|[VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/)|.NET 6|.NET 7|.NET 8|\n|:---:|:---:|:---:|:---:|\n|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.1.0/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/1.1.0)|[![.NET 7](https://badgen.net/badge/nuget/v2.1.3/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/2.1.3)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit.Core/?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/)|\n\u003c!--\n|Preview|-|-|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit.Core/latest?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/absoluteLatest)|\n--\u003e\n\nThe objective is to ease the development of the `Razor Class Library` (RCL) so that it can be shared with all Blazor targets (.NET MAUI, Server, WebAssembly, Windows Forms, and WPF).\n\nAnd .NET MAUI targets Android, iOS, macOS (via Mac Catalyst), Tizen, and Windows (via WinUI 3).\n\nTo start with define the following abstractions:\n\n* Dialogs - `IDialogService`\n* Navigation - `INavigationService`\n* Share - `IShareService`\n* Theme - `IThemeService`\n\nA Model class for UserToken and frequently used Constants for OAuth / OIDC authentication.\n\n### VijayAnand.MauiToolkit\n\nThis is a toolkit with a set of helper methods and classes to simplify working with .NET MAUI and Blazor.\n\n|[VijayAnand.MauiToolkit](https://www.nuget.org/packages/VijayAnand.MauiToolkit/)|.NET 6|.NET 7|.NET 8|\n|:---:|:---:|:---:|:---:|\n|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.1.0/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit/1.1.0)|[![.NET 7](https://badgen.net/badge/nuget/v2.1.3/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit/2.1.3)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit/?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiToolkit/)|\n\u003c!--\n|Preview|-|-|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit/latest?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit/absoluteLatest)|\n--\u003e\n\nIt depends on [VijayAnand.MauiToolkit.Core](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Core/) NuGet package.\n\nTo start with, implement the concrete definition of the abstractions defined in the Core package:\n\n* Dialogs - `DialogService` (works with MainPage or Shell definition)\n  - Additional abstraction specific to .NET MAUI with `FlowDirection`\n* Navigation - `NavigationService` (based on Shell Navigation pattern)\n* Share - `ShareService` (based on Maui Essentials)\n* Theme - `ThemeService` (based on UserAppTheme property)\n\nAnd includes a set of Markup extension methods for rapid application development with C#.\n\nThese fluent APIs are made available in the `VijayAnand.MauiToolkit.Markup` namespace.\n\nProvides an extension method to register these services in .NET MAUI host builder startup:\n\n`UseVijayAnandMauiToolkit()`\n\nNow it's possible to selectively register the services required into the DI container.\n\nAdded a configuration parameter of Enum type `ServiceRegistrations` (Flags-attributed) to the `UseVijayAnandMauiToolkit()` method.\n\nTo illustrate with a sample, if only interested in NavigationService:\n\nThen, invoke `UseVijayAnandMauiToolkit(ServiceRegistrations.Navigation)`.\n\nAnd if DialogService is required along with NavigationService:\n\nThen, invoke `UseVijayAnandMauiToolkit(ServiceRegistrations.Dialogs | ServiceRegistrations.Navigation)`.\n\nBy default, the default value of the configuration parameter is set to `ServiceRegistrations.All`.\n\nUsage:\n\n```cs\npublic static class MauiProgram\n{\n    public static MauiApp CreateMauiApp()\n    {\n        var builder = MauiApp.CreateBuilder();\n        builder.UseMauiApp\u003cApp\u003e()\n               .UseVijayAnandMauiToolkit(); // Implicit value of ServiceRegistrations.All passed as a configuration parameter\n        return builder.Build();\n    }\n}\n```\n### VijayAnand.MauiToolkit.Pro\n\nThis is a toolkit with a set of helper methods and classes to simplify working with .NET MAUI and Blazor.\n\n|[VijayAnand.MauiToolkit.Pro](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Pro/)|.NET 6|.NET 7|.NET 8|\n|:---:|:---:|:---:|:---:|\n|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.1.0/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Pro/1.1.0)|[![.NET 7](https://badgen.net/badge/nuget/v2.1.3/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Pro/2.1.3)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit.Pro/?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Pro/)|\n\u003c!--\n|Preview|-|-|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiToolkit.Pro/latest?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiToolkit.Pro/absoluteLatest)|\n--\u003e\n\nIt depends on the following NuGet packages:\n\n* [CommunityToolkit.Maui](https://www.nuget.org/packages/CommunityToolkit.Maui/)\n* [VijayAnand.MauiToolkit](https://www.nuget.org/packages/VijayAnand.MauiToolkit/)\n\nTo start with implements the concrete definition `PopupDialogService` for the `IDialogService` abstraction defined in the Core package and `IMauiDialogService` abstraction defined in the Regular package with the `Popup` type from the `CommunityToolkit.Maui` NuGet package.\n\nProvides an extension method to register this service in .NET MAUI host builder startup:\n\n`UseVijayAnandMauiToolkitPro()`\n\nBy default, the default value of the configuration parameter is set to `ServiceRegistrations.All`.\n\nUsage:\n\n```cs\npublic static class MauiProgram\n{\n    public static MauiApp CreateMauiApp()\n    {\n        var builder = MauiApp.CreateBuilder();\n        builder.UseMauiApp\u003cApp\u003e()\n               .UseMauiCommunityToolkit()\n               .UseVijayAnandMauiToolkitPro(); // Implicit value of ServiceRegistrations.All passed as configuration parameter\n\n        return builder.Build();\n    }\n}\n```\n\n### VijayAnand.MauiBlazor.Markup\n\nThis [markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/) package is a set of fluent helper methods and classes to simplify working with .NET MAUI Blazor in C#.\n\nIt depends on the [Microsoft.AspNetCore.Components.WebView.Maui](https://www.nuget.org/packages/Microsoft.AspNetCore.Components.WebView.Maui) NuGet package.\n\n|Channel|.NET 8|.NET 9|\n|:---:|:---:|:---:|\n|Stable|[![.NET 8](https://badgen.net/badge/nuget/v3.0.8/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/3.0.8)|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup)|\n\u003c!--|Preview|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup/latest?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/absoluteLatest)|--\u003e\n\n\u003c!--|[VijayAnand.MauiBlazor.Markup](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/)|.NET 6|.NET 7|.NET 8|.NET 9|\n|:---:|:---:|:---:|:---:|:---:|\n|Stable|[![.NET 6](https://badgen.net/badge/nuget/v1.0.12/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/1.0.12)|[![.NET 7](https://badgen.net/badge/nuget/v2.0.10/blue?icon=nuget)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/2.0.10)|[![.NET 8](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup)|-|\n|Preview|-|-|-|[![.NET 9](https://badgen.net/nuget/v/VijayAnand.MauiBlazor.Markup/latest?icon=nuget\u0026foo=bar)](https://www.nuget.org/packages/VijayAnand.MauiBlazor.Markup/absoluteLatest)|--\u003e\n\nThe most useful method will be `Configure`, which can be invoked on an instance of a BlazorWebView and its derivatives, and it simplifies the initialization of BlazorWebView into a single fluent method call as shown in the below sample.\n\nNote: `Gateway` is a `Razor` component and assumes it can receive a parameter named `Foo` as described in the sample underneath.\n\n```cs\nnamespace MyApp;\n\npublic class HomePage : ContentPage\n{\n    public HomePage()\n    {\n        // A BlazorWebView can manage multiple RootComponents, to achieve this, define another Tuple with values of that component\n        // The method and Tuple parameter names are shown for clarity and it's optional\n        // Blazor component can have initialization parameters, which can be supplied through parameters, a dictionary of keyValues\n        // where the key is of type string and value is of type object\n\n        // Without initialization parameters\n        Content = new BlazorWebView().Configure(hostPage: \"wwwroot/index.html\", (selector: \"#app\", componentType: typeof(Gateway), parameters: null));\n\n        // With optional initialization parameters\n        Content = new BlazorWebView().Configure(hostPage: \"wwwroot/index.html\", (selector: \"#app\", componentType: typeof(Gateway), parameters: new Dictionary\u003cstring, object?\u003e { [nameof(Gateway.Foo)] = \"Bar\" }));\n\n        // In a simplified form - Real intended usage\n        // Without initialization parameters\n        Content = new BlazorWebView().Configure(\"wwwroot/index.html\", (\"#app\", typeof(Gateway), null));\n        // Much more simplified, assuming hostPage is wwwroot/index.html and selector as #app\n        Content = new BlazorWebView().Configure(typeof(Gateway));\n\n        // With StartPath property introduced in .NET 8 or later, overloaded Configure method\n        // Assuming search is the page with which the app is intended to start\n        Content = new BlazorWebView().Configure(\"wwwroot/index.html\", \"/search\", (\"#app\", typeof(Gateway), null));\n        // Much more simplified version, assuming hostPage is wwwroot/index.html and selector as #app\n        Content = new BlazorWebView().Configure(typeof(Gateway), \"/search\");\n\n        // With optional initialization parameters\n        Content = new BlazorWebView().Configure(\"wwwroot/index.html\", (\"#app\", typeof(Gateway), new Dictionary\u003cstring, object?\u003e { [nameof(Gateway.Foo)] = \"Bar\" }));\n    }\n}\n```\n```razor\n@page \"/gateway\"\n\n\u003ch2\u003eI'm a razor component named Gateway and I can receive a parameter named Foo.\u003c/h2\u003e\n\n@code {\n    [Parameter]\n    public string Foo { get; set; }\n}\n```\n\u003c!--\n```CS\n// For brevity, only the necessary code is made available. This can be nested anywhere a View can be defined\n// The method and Tuple parameter names are shown for clarity and it's optional\n// A BlazorWebView can manage multiple RootComponents, to achieve this, define another Tuple with values of that component\n// Blazor component can have initialization parameters, which can be supplied thro parameters, a dictionary of keyValues\n// where the key is of type string and the value is of type object\nnew BlazorWebView().Configure(hostPage: \"wwwroot/index.html\", (selector: \"#app\", componentType: typeof(Gateway), parameters: null))\n// Another example with component initialization parameters\nnew BlazorWebView().Configure(hostPage: \"wwwroot/index.html\", (selector: \"#app\", componentType: typeof(Gateway), parameters: new Dictionary\u003cstring, object?\u003e { [\"Foo\"] = \"Bar\" }))\n```\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegvijayanand%2Fdotnet-maui-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegvijayanand%2Fdotnet-maui-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegvijayanand%2Fdotnet-maui-toolkit/lists"}