33 lines
1 KiB
C#
33 lines
1 KiB
C#
using Microsoft.AspNetCore.Components.Authorization;
|
|
using Microsoft.Extensions.Logging;
|
|
using Neighbourhood.omg.lol.Models;
|
|
|
|
namespace Neighbourhood.omg.lol {
|
|
public static class MauiProgram {
|
|
public static MauiApp CreateMauiApp() {
|
|
var builder = MauiApp.CreateBuilder();
|
|
builder
|
|
.UseMauiApp<App>()
|
|
.ConfigureFonts(fonts => {
|
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
});
|
|
|
|
builder.Services.AddMauiBlazorWebView();
|
|
builder.Services.AddTransient<LoginWebViewPage>();
|
|
|
|
builder.Services.AddSingleton<State>();
|
|
builder.Services.AddSingleton<NavigatorService>();
|
|
|
|
builder.Services.AddAuthorizationCore();
|
|
builder.Services.AddScoped<CustomAuthenticationStateProvider>();
|
|
builder.Services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<CustomAuthenticationStateProvider>());
|
|
|
|
#if DEBUG
|
|
builder.Services.AddBlazorWebViewDeveloperTools();
|
|
builder.Logging.AddDebug();
|
|
#endif
|
|
|
|
return builder.Build();
|
|
}
|
|
}
|
|
}
|