Skip to content

Commit

Permalink
Merge pull request #20 from maonaoda/master
Browse files Browse the repository at this point in the history
fix: fix #18 Injection
  • Loading branch information
dansiegel authored May 14, 2024
2 parents c545530 + cfdfc89 commit f81086f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/MauiMicroMvvm/Internals/DefaultNavigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
namespace MauiMicroMvvm.Internals;

[EditorBrowsable(EditorBrowsableState.Never)]
public class DefaultNavigation : INavigation
public class DefaultNavigation<TShell> : 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<string, object> parameters) =>
Expand Down
6 changes: 3 additions & 3 deletions src/MauiMicroMvvm/Internals/PageDialogs.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
namespace MauiMicroMvvm.Internals;

internal class PageDialogs : IPageDialogs
internal class PageDialogs<TShell> : IPageDialogs where TShell : Shell
{
private readonly Shell _shell;
private readonly TShell _shell;

public PageDialogs(Shell shell)
public PageDialogs(TShell shell)
{
_shell = shell;
}
Expand Down
6 changes: 3 additions & 3 deletions src/MauiMicroMvvm/MauiMicroBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public static MauiAppBuilder UseMauiMicroMvvm<TShell>(this MauiAppBuilder builde
.AddSingleton<IWindowCreator, WindowCreator<TShell>>()
.AddSingleton<IViewFactory, ViewFactory>()
.AddSingleton<IBehaviorFactory, BehaviorFactory>()
.AddSingleton<INavigation, DefaultNavigation>()
.AddSingleton<IPageDialogs, PageDialogs>()
.AddSingleton<INavigation, DefaultNavigation<TShell>>()
.AddSingleton<IPageDialogs, PageDialogs<TShell>>()
.AddScoped<ViewModelContext>();
return builder;
}
Expand Down Expand Up @@ -58,7 +58,7 @@ public static MauiAppBuilder UseMauiMicroMvvm<TApp, TShell>(this MauiAppBuilder
{string.Join('\n', qualifiedResources)}
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>";

app.Resources.LoadFromXaml(xaml);
}

Expand Down

0 comments on commit f81086f

Please sign in to comment.