diff --git a/src/Mobile/MauiProgram.cs b/src/Mobile/MauiProgram.cs index c87c666..5e70769 100644 --- a/src/Mobile/MauiProgram.cs +++ b/src/Mobile/MauiProgram.cs @@ -25,15 +25,6 @@ public static class MauiProgram Barrel.ApplicationId = "dotnetpodcasts"; - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); - builder.Services.AddTransient(); return builder.Build(); } diff --git a/src/Mobile/Pages/PagesExtensions.cs b/src/Mobile/Pages/PagesExtensions.cs index deea318..f7d784d 100644 --- a/src/Mobile/Pages/PagesExtensions.cs +++ b/src/Mobile/Pages/PagesExtensions.cs @@ -1,15 +1,23 @@ -namespace Microsoft.NetConf2021.Maui.Pages; +namespace Microsoft.NetConf2021.Maui.Pages; public static class PagesExtensions { public static MauiAppBuilder ConfigurePages(this MauiAppBuilder builder) { + // main tabs of the app builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); + // pages that are navigated to + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + builder.Services.AddTransient(); + return builder; } }