Merge pull request #42 from brunck/shell-di-changes

Support Shell DI changes in .NET MAUI P14
pull/45/head
James Montemagno 2022-03-08 14:42:58 -08:00 committed by GitHub
commit cbde8681c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -13,6 +13,7 @@ public static class MauiProgram
.UseMauiApp<App>()
.ConfigureEssentials()
.ConfigureServices()
.ConfigurePages()
.ConfigureViewModels()
.ConfigureFonts(fonts =>
{

View File

@ -0,0 +1,15 @@
namespace Microsoft.NetConf2021.Maui.Pages;
public static class PagesExtensions
{
public static MauiAppBuilder ConfigurePages(this MauiAppBuilder builder)
{
builder.Services.AddSingleton<DiscoverPage>();
builder.Services.AddSingleton<SubscriptionsPage>();
builder.Services.AddSingleton<ListenLaterPage>();
builder.Services.AddSingleton<ListenTogetherPage>();
builder.Services.AddSingleton<SettingsPage>();
return builder;
}
}