From cfdfc894444e325a44f63c16f9c0f6084f0f53fd Mon Sep 17 00:00:00 2001 From: maonaoda Date: Tue, 14 May 2024 14:16:34 +0900 Subject: [PATCH] fix: fix #18 Injection fix: fix #18 Injection --- src/MauiMicroMvvm/Internals/DefaultNavigation.cs | 8 ++++---- src/MauiMicroMvvm/Internals/PageDialogs.cs | 6 +++--- src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/MauiMicroMvvm/Internals/DefaultNavigation.cs b/src/MauiMicroMvvm/Internals/DefaultNavigation.cs index a79238d..97faa04 100644 --- a/src/MauiMicroMvvm/Internals/DefaultNavigation.cs +++ b/src/MauiMicroMvvm/Internals/DefaultNavigation.cs @@ -3,16 +3,16 @@ namespace MauiMicroMvvm.Internals; [EditorBrowsable(EditorBrowsableState.Never)] -public class DefaultNavigation : INavigation +public class DefaultNavigation : INavigation where TShell : Shell { - private readonly Shell _shell; + private readonly TShell _shell; - public DefaultNavigation(Shell shell) + public DefaultNavigation(TShell shell) { _shell = shell; } - public async Task GoToAsync(string uri) => + public async Task GoToAsync(string uri) => await _shell.GoToAsync(uri); public async Task GoToAsync(string uri, IDictionary parameters) => diff --git a/src/MauiMicroMvvm/Internals/PageDialogs.cs b/src/MauiMicroMvvm/Internals/PageDialogs.cs index e2c90fa..055d170 100644 --- a/src/MauiMicroMvvm/Internals/PageDialogs.cs +++ b/src/MauiMicroMvvm/Internals/PageDialogs.cs @@ -1,10 +1,10 @@ namespace MauiMicroMvvm.Internals; -internal class PageDialogs : IPageDialogs +internal class PageDialogs : IPageDialogs where TShell : Shell { - private readonly Shell _shell; + private readonly TShell _shell; - public PageDialogs(Shell shell) + public PageDialogs(TShell shell) { _shell = shell; } diff --git a/src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs b/src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs index 70d6c2d..3e1ab8a 100644 --- a/src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs +++ b/src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs @@ -15,8 +15,8 @@ public static MauiAppBuilder UseMauiMicroMvvm(this MauiAppBuilder builde .AddSingleton>() .AddSingleton() .AddSingleton() - .AddSingleton() - .AddSingleton() + .AddSingleton>() + .AddSingleton>() .AddScoped(); return builder; } @@ -58,7 +58,7 @@ public static MauiAppBuilder UseMauiMicroMvvm(this MauiAppBuilder {string.Join('\n', qualifiedResources)} "; - + app.Resources.LoadFromXaml(xaml); }