Merge pull request #54 from microsoft/page-registration

Update registration of pages
pull/55/head
James Montemagno 2022-03-24 10:47:24 -07:00 committed by GitHub
commit d5a05e8c80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 10 deletions

View File

@ -25,15 +25,6 @@ public static class MauiProgram
Barrel.ApplicationId = "dotnetpodcasts"; Barrel.ApplicationId = "dotnetpodcasts";
builder.Services.AddTransient<CategoriesPage>();
builder.Services.AddTransient<CategoryPage>();
builder.Services.AddTransient<DiscoverPage>();
builder.Services.AddTransient<EpisodeDetailPage>();
builder.Services.AddTransient<ListenLaterPage>();
builder.Services.AddTransient<ListenTogetherPage>();
builder.Services.AddTransient<SettingsPage>();
builder.Services.AddTransient<ShowDetailPage>();
builder.Services.AddTransient<SubscriptionsPage>();
return builder.Build(); return builder.Build();
} }

View File

@ -1,15 +1,23 @@
namespace Microsoft.NetConf2021.Maui.Pages; namespace Microsoft.NetConf2021.Maui.Pages;
public static class PagesExtensions public static class PagesExtensions
{ {
public static MauiAppBuilder ConfigurePages(this MauiAppBuilder builder) public static MauiAppBuilder ConfigurePages(this MauiAppBuilder builder)
{ {
// main tabs of the app
builder.Services.AddSingleton<DiscoverPage>(); builder.Services.AddSingleton<DiscoverPage>();
builder.Services.AddSingleton<SubscriptionsPage>(); builder.Services.AddSingleton<SubscriptionsPage>();
builder.Services.AddSingleton<ListenLaterPage>(); builder.Services.AddSingleton<ListenLaterPage>();
builder.Services.AddSingleton<ListenTogetherPage>(); builder.Services.AddSingleton<ListenTogetherPage>();
builder.Services.AddSingleton<SettingsPage>(); builder.Services.AddSingleton<SettingsPage>();
// pages that are navigated to
builder.Services.AddTransient<CategoriesPage>();
builder.Services.AddTransient<CategoryPage>();
builder.Services.AddTransient<EpisodeDetailPage>();
builder.Services.AddTransient<ShowDetailPage>();
builder.Services.AddTransient<SubscriptionsPage>();
return builder; return builder;
} }
} }