49 lines
2.0 KiB
C#
49 lines
2.0 KiB
C#
using CommunityToolkit.Maui;
|
|
using MauiApp.Core;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace MauiApp;
|
|
|
|
public static class MauiProgram
|
|
{
|
|
public static IServiceProvider ServiceProvider { get; private set; }
|
|
|
|
public static Microsoft.Maui.Hosting.MauiApp CreateMauiApp()
|
|
{
|
|
var builder = Microsoft.Maui.Hosting.MauiApp.CreateBuilder();
|
|
builder
|
|
.UseMauiApp<App>()
|
|
.UseMauiCommunityToolkit()
|
|
.ConfigureFonts(fonts =>
|
|
{
|
|
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
|
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
|
fonts.AddFont("materialdesignicons-webfont.ttf", "MaterialDesignIcons");
|
|
fonts.AddFont("ReferenzGrotesk-Black.otf", "ReferenzGroteskBlack");
|
|
fonts.AddFont("ReferenzGrotesk-BlackItalic.otf", "ReferenzGroteskBlackItalic");
|
|
fonts.AddFont("ReferenzGrotesk-Bold.otf", "ReferenzGroteskBold");
|
|
fonts.AddFont("ReferenzGrotesk-BoldItalic.otf", "ReferenzGroteskBoldItalic");
|
|
fonts.AddFont("ReferenzGrotesk-ExtraBold.otf", "ReferenzGroteskExtraBold");
|
|
fonts.AddFont("ReferenzGrotesk-ExtraBoldItalic.otf", "ReferenzGroteskExtraBoldItalic");
|
|
fonts.AddFont("ReferenzGrotesk-Light.otf", "ReferenzGroteskLight");
|
|
fonts.AddFont("ReferenzGrotesk-LightItalic.otf", "ReferenzGroteskLightItalic");
|
|
fonts.AddFont("ReferenzGrotesk-Medium.otf", "ReferenzGroteskMedium");
|
|
fonts.AddFont("ReferenzGrotesk-MediumItalic.otf", "ReferenzGroteskMediumItalic");
|
|
fonts.AddFont("ReferenzGrotesk-Regular.otf", "ReferenzGroteskRegular");
|
|
fonts.AddFont("ReferenzGrotesk-RegularItalic.otf", "ReferenzGroteskRegularItalic");
|
|
});
|
|
|
|
builder.RegisterAppServices()
|
|
.RegisterViews();
|
|
|
|
|
|
#if DEBUG
|
|
builder.Logging.AddDebug();
|
|
#endif
|
|
var builded = builder.Build();
|
|
|
|
ServiceProvider = builded.Services;
|
|
|
|
return builded;
|
|
}
|
|
} |