{"id":13692048,"url":"https://github.com/matt-goldman/Maui.Plugins.PageResolver","last_synced_at":"2025-05-02T19:31:10.735Z","repository":{"id":38017133,"uuid":"377646907","full_name":"matt-goldman/Maui.Plugins.PageResolver","owner":"matt-goldman","description":"A simple and lightweight page resolver for use in .NET MAUI projects","archived":false,"fork":false,"pushed_at":"2024-07-29T22:54:46.000Z","size":256,"stargazers_count":127,"open_issues_count":1,"forks_count":11,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-08-03T17:13:14.773Z","etag":null,"topics":["dependency-injection","dotnet","dotnetmaui","source-generator"],"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/matt-goldman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2021-06-16T22:51:25.000Z","updated_at":"2024-07-29T22:54:47.000Z","dependencies_parsed_at":"2024-07-30T03:59:39.887Z","dependency_job_id":null,"html_url":"https://github.com/matt-goldman/Maui.Plugins.PageResolver","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-goldman%2FMaui.Plugins.PageResolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-goldman%2FMaui.Plugins.PageResolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-goldman%2FMaui.Plugins.PageResolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matt-goldman%2FMaui.Plugins.PageResolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matt-goldman","download_url":"https://codeload.github.com/matt-goldman/Maui.Plugins.PageResolver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224328486,"owners_count":17293264,"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":["dependency-injection","dotnet","dotnetmaui","source-generator"],"created_at":"2024-08-02T17:00:53.048Z","updated_at":"2024-11-12T18:30:17.292Z","avatar_url":"https://github.com/matt-goldman.png","language":"C#","funding_links":[],"categories":["Plugins"],"sub_categories":["Get Started"],"readme":"[![NuGet Status](https://img.shields.io/nuget/v/Goldie.MauiPlugins.PageResolver.svg?style=flat)](https://www.nuget.org/packages/Goldie.MauiPlugins.PageResolver/) [![Nuget](https://img.shields.io/nuget/dt/Goldie.MauiPlugins.PageResolver)](https://www.nuget.org/packages/Goldie.MauiPlugins.PageResolver)\n\n## Watch the video:\n\n\u003ca href=\"http://www.youtube.com/watch?feature=player_embedded\u0026v=qx8A4zIe9dU\" target=\"_blank\"\u003e\n \u003cimg src=\"http://img.youtube.com/vi/qx8A4zIe9dU/hqdefault.jpg\" alt=\"Watch the video\" /\u003e\n\u003c/a\u003e\n\n# MAUI PageResolver\nA simple and lightweight page resolver for use in .NET MAUI projects.\n\nIf you want a simple page resolver with DI without using a full MVVM framework (or if you want to use MVU), this package will let you navigate to fully resolved pages, with view models and dependencies, by calling:\n\n```cs\nawait Navigation.PushAsync\u003cMyPage\u003e();\n```\n\n# Advanced features\n\nAdditional features supported by PageReolver:\n* Paramaterised navigation - pass page parameters\n\n```csharp\nawait Navigation.PushAsync\u003cMyPage\u003e(myPageParam1, \"bob\", 4);\n```\n\n* Paramaterised navigation - pass ViewModel parameters (.NET 8 version only)\n\n```csharp\nawait Navigation.PushAsync\u003cMyPage\u003e(myViewModelParam1, \"bob\", 4);\n```\n\n* Source generator - automatically register dependencies in `IServiceCollection` with generated code (.NET 8 version only)\n\n```csharp\nusing Maui.Plugins.PageResolver;\nusing DemoProject;\nusing DemoProject.Pages;\nusing DemoProject.ViewModels;\nusing DemoProject.Services;\n// ---------------\n// \u003cauto-generated\u003e\n//   Generated by the MauiPageResolver Auto-registration module.\n//   https://github.com/matt-goldman/Maui.Plugins.PageResolver\n// \u003c/auto-generated\u003e\n// ---------------\n\nnamespace DemoProject;\n\npublic static class PageResolverExtensions\n{\n\n    public static MauiAppBuilder UseAutodependencies(this MauiAppBuilder builder)\n    {\n         var ViewModelMappings = new Dictionary\u003cType, Type\u003e();\n\n         // pages\n         builder.Services.AddTransient\u003cMainPage\u003e();\n\n\n         // ViewModels\n         builder.Services.AddTransient\u003cMainViewModel\u003e();\n\n\n         // Services\n         builder.Services.AddSingleton\u003cIDefaultScopedService, DefaultScopedService\u003e();\n         builder.Services.AddTransient\u003cICustomScopedService, CustomScopedService\u003e();\n\n\n         // ViewModel to Page mappings\n         ViewModelMappings.Add(typeof(MainPage), typeof(MainViewModel));\n\n\n         // Initialisation\n         builder.Services.UsePageResolver(ViewModelMappings);\n         return builder;\n    }\n}\n```\n\n* Lifetime attributes - override convention-based service lifetimes (singleton for services, transient for pages and ViewModels) in the source generator (.NET 8 version only)\n\n```csharp\n[Transient]\npublic class CustomScopedService : ICustomScopedService\n{\n[...]\n```\n\n# Getting Started\n\nCheck out the full instructions in the wiki on [using PageResolver](https://github.com/matt-goldman/Maui.Plugins.PageResolver/wiki/1-Using-the-PageResolver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-goldman%2FMaui.Plugins.PageResolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatt-goldman%2FMaui.Plugins.PageResolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatt-goldman%2FMaui.Plugins.PageResolver/lists"}