flower-story/FlowerApp/MauiProgram.cs
2023-07-27 22:07:24 +08:00

37 lines
904 B
C#

using Blahblah.FlowerApp.Data;
using CommunityToolkit.Maui;
#if DEBUG
using Microsoft.Extensions.Logging;
#endif
namespace Blahblah.FlowerApp;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
})
.ConfigureMauiHandlers(handlers =>
{
});
#if DEBUG
builder.Logging.AddDebug();
#endif
builder.Services.AddSingleton<HomePage>();
builder.Services.AddSingleton<FlowerDatabase>();
builder.Services.AddLocalization();
return builder.Build();
}
}