Goldie.MauiPlugins.PageResolver.MopupsExtensions
2.5.1
dotnet add package Goldie.MauiPlugins.PageResolver.MopupsExtensions --version 2.5.1
NuGet\Install-Package Goldie.MauiPlugins.PageResolver.MopupsExtensions -Version 2.5.1
<PackageReference Include="Goldie.MauiPlugins.PageResolver.MopupsExtensions" Version="2.5.1" />
<PackageVersion Include="Goldie.MauiPlugins.PageResolver.MopupsExtensions" Version="2.5.1" />
<PackageReference Include="Goldie.MauiPlugins.PageResolver.MopupsExtensions" />
paket add Goldie.MauiPlugins.PageResolver.MopupsExtensions --version 2.5.1
#r "nuget: Goldie.MauiPlugins.PageResolver.MopupsExtensions, 2.5.1"
#:package Goldie.MauiPlugins.PageResolver.MopupsExtensions@2.5.1
#addin nuget:?package=Goldie.MauiPlugins.PageResolver.MopupsExtensions&version=2.5.1
#tool nuget:?package=Goldie.MauiPlugins.PageResolver.MopupsExtensions&version=2.5.1
Watch the video:
<a href="http://www.youtube.com/watch?feature=player_embedded&v=qx8A4zIe9dU" target="_blank"> <img src="http://img.youtube.com/vi/qx8A4zIe9dU/hqdefault.jpg" alt="Watch the video" /> </a>
MAUI PageResolver
A simple and lightweight page resolver for use in .NET MAUI projects.
If 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:
await Navigation.PushAsync<MyPage>();
Advanced features
Additional features supported by PageReolver:
- Paramaterised navigation - pass page parameters
await Navigation.PushAsync<MyPage>(myPageParam1, "bob", 4);
- Paramaterised navigation - pass ViewModel parameters (.NET 8 version only)
await Navigation.PushAsync<MyPage>(myViewModelParam1, "bob", 4);
- Source generator - automatically register dependencies in
IServiceCollection
with generated code (.NET 8 version only)
using Maui.Plugins.PageResolver;
using DemoProject;
using DemoProject.Pages;
using DemoProject.ViewModels;
using DemoProject.Services;
// ---------------
// <auto-generated>
// Generated by the MauiPageResolver Auto-registration module.
// https://github.com/matt-goldman/Maui.Plugins.PageResolver
// </auto-generated>
// ---------------
namespace DemoProject;
public static class PageResolverExtensions
{
public static MauiAppBuilder UseAutodependencies(this MauiAppBuilder builder)
{
var ViewModelMappings = new Dictionary<Type, Type>();
// pages
builder.Services.AddTransient<MainPage>();
// ViewModels
builder.Services.AddTransient<MainViewModel>();
// Services
builder.Services.AddSingleton<IDefaultScopedService, DefaultScopedService>();
builder.Services.AddTransient<ICustomScopedService, CustomScopedService>();
// ViewModel to Page mappings
ViewModelMappings.Add(typeof(MainPage), typeof(MainViewModel));
// Initialisation
builder.Services.UsePageResolver(ViewModelMappings);
return builder;
}
}
- Lifetime attributes - override convention-based service lifetimes (singleton for services, transient for pages and ViewModels) in the source generator (.NET 8 version only)
[Transient]
public class CustomScopedService : ICustomScopedService
{
[...]
Getting Started
Check out the full instructions in the wiki on using PageResolver
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Goldie.MauiPlugins.PageResolver (>= 2.5.1)
- Mopups (>= 1.3.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
2.5.1 | 988 | 11/3/2024 |