Neighbourhood.omg.lol/MauiProgram.cs

30 lines
900 B
C#
Raw Normal View History

using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.Logging;
2024-05-30 01:06:08 +00:00
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.AddAuthorizationCore();
builder.Services.AddScoped<CustomAuthenticationStateProvider>();
builder.Services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<CustomAuthenticationStateProvider>());
2024-05-30 01:06:08 +00:00
#if DEBUG
builder.Services.AddBlazorWebViewDeveloperTools();
2024-05-30 01:06:08 +00:00
builder.Logging.AddDebug();
#endif
return builder.Build();
}
}
}