Update registration of pages

pull/54/head
James Montemagno 2022-03-24 10:31:17 -07:00
parent 6a1cbb018c
commit 1d8fbbb62c
2 changed files with 9 additions and 10 deletions

View File

@ -25,15 +25,6 @@ public static class MauiProgram
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();
}

View File

@ -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<DiscoverPage>();
builder.Services.AddSingleton<SubscriptionsPage>();
builder.Services.AddSingleton<ListenLaterPage>();
builder.Services.AddSingleton<ListenTogetherPage>();
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;
}
}